mirror of
https://github.com/logos-storage/questionable.git
synced 2026-01-07 00:03:10 +00:00
Simplify
This commit is contained in:
parent
fca4c14e0c
commit
d82581244c
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user