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