mirror of
https://github.com/logos-storage/questionable.git
synced 2026-01-03 22:33:07 +00:00
Test binding of optional tuple, not just tuple
This commit is contained in:
parent
6ccb74419f
commit
decda57024
@ -198,20 +198,20 @@ suite "optionals":
|
|||||||
fail()
|
fail()
|
||||||
|
|
||||||
test "=? binds and unpacks tuples with _":
|
test "=? binds and unpacks tuples with _":
|
||||||
if (_, b) =? ("test", 1):
|
if (_, b) =? some ("test", 1):
|
||||||
check b == 1
|
check b == 1
|
||||||
else:
|
else:
|
||||||
fail()
|
fail()
|
||||||
|
|
||||||
test "=? binds and unpacks tuples with named fields":
|
test "=? binds and unpacks tuples with named fields":
|
||||||
if (a, b) =? (desc: "test", id: 1):
|
if (a, b) =? some (desc: "test", id: 1):
|
||||||
check a == "test"
|
check a == "test"
|
||||||
check b == 1
|
check b == 1
|
||||||
else:
|
else:
|
||||||
fail()
|
fail()
|
||||||
|
|
||||||
test "=? binds variable to tuples with named fields":
|
test "=? binds variable to tuples with named fields":
|
||||||
if t =? (desc: "test", id: 1):
|
if t =? some (desc: "test", id: 1):
|
||||||
check t.desc == "test"
|
check t.desc == "test"
|
||||||
check t.id == 1
|
check t.id == 1
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user