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() test2()
test "without statement evaluates optional expression only once": test "without statement evaluates optional expression only once":
proc test = var count = 0
var count = 0 without a =? (inc count; 42.some):
without a =? (inc count; 42.some): discard
discard check count == 1
check count == 1
test()
test ".?[] can be used for indexing tables without raising KeyError": test ".?[] can be used for indexing tables without raising KeyError":
let table = @{"a": 1, "b": 2}.toTable let table = @{"a": 1, "b": 2}.toTable