mirror of
https://github.com/logos-storage/questionable.git
synced 2026-05-20 16:59:45 +00:00
Additional test for nested without statements
This commit is contained in:
parent
e719504ab6
commit
de0ad2aa0c
@ -274,6 +274,13 @@ suite "result":
|
|||||||
|
|
||||||
test(int)
|
test(int)
|
||||||
|
|
||||||
|
test "without statements can be nested":
|
||||||
|
without a =? int.failure "error1", e1:
|
||||||
|
without b =? int.failure "error2", e2:
|
||||||
|
check e1.msg == "error1"
|
||||||
|
check e2.msg == "error2"
|
||||||
|
check e1.msg == "error1"
|
||||||
|
|
||||||
test "catch can be used to convert exceptions to results":
|
test "catch can be used to convert exceptions to results":
|
||||||
check parseInt("42").catch == 42.success
|
check parseInt("42").catch == 42.success
|
||||||
check parseInt("foo").catch.error of ValueError
|
check parseInt("foo").catch.error of ValueError
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user