mirror of
https://github.com/logos-storage/questionable.git
synced 2026-01-04 23:03:12 +00:00
Add tests for failed tuple bindings
This commit is contained in:
parent
935535a76e
commit
6382af43b3
@ -172,6 +172,11 @@ suite "optionals":
|
||||
else:
|
||||
fail()
|
||||
|
||||
if (a, b) =? none (string, int):
|
||||
discard a
|
||||
discard b
|
||||
fail()
|
||||
|
||||
test "=? binds and unpacks tuples with named fields":
|
||||
if (a, b) =? (some (desc: "test", id: 1)):
|
||||
check a == "test"
|
||||
|
||||
@ -172,6 +172,11 @@ suite "result":
|
||||
else:
|
||||
fail()
|
||||
|
||||
if (a, b) =? (string, int).failure(error):
|
||||
discard a
|
||||
discard b
|
||||
fail()
|
||||
|
||||
test "=? binds and unpacks tuples with named fields":
|
||||
if (a, b) =? (success (desc: "test", id: 1)):
|
||||
check a == "test"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user