test integration "counter accumulates" {
  wires demo.api, demo.counter

  test "two ticks on the same id accumulate across the wire" {
    let a <- demo.api.tick("c1")
    let b <- demo.api.tick("c1")
    match b {
      Ok(n)  => assert n == 2
      Err(_) => assert false
    }
  }

  test "a fresh id starts from zero in a new case" {
    let a <- demo.api.tick("c2")
    match a {
      Ok(n)  => assert n == 1
      Err(_) => assert false
    }
  }
}
