This commit is contained in:
Mark Spanbroek 2021-04-17 19:25:33 +02:00
parent fca4c14e0c
commit d82581244c

View File

@ -132,13 +132,10 @@ suite "optionals":
test2()
test "without statement evaluates optional expression only once":
proc test =
var count = 0
without a =? (inc count; 42.some):
discard
check count == 1
test()
var count = 0
without a =? (inc count; 42.some):
discard
check count == 1
test ".?[] can be used for indexing tables without raising KeyError":
let table = @{"a": 1, "b": 2}.toTable