mirror of
https://github.com/logos-storage/questionable.git
synced 2026-03-21 20:13:13 +00:00
Replace "check false" with "fail"
This commit is contained in:
parent
1d5a0222a7
commit
21927f3c88
@ -47,19 +47,19 @@ suite "optionals":
|
|||||||
|
|
||||||
test "=? can be used for optional binding":
|
test "=? can be used for optional binding":
|
||||||
if a =? int.none:
|
if a =? int.none:
|
||||||
check false
|
fail
|
||||||
|
|
||||||
if b =? 42.some:
|
if b =? 42.some:
|
||||||
check b == 42
|
check b == 42
|
||||||
else:
|
else:
|
||||||
check false
|
fail
|
||||||
|
|
||||||
while a =? 42.some:
|
while a =? 42.some:
|
||||||
check a == 42
|
check a == 42
|
||||||
break
|
break
|
||||||
|
|
||||||
while a =? int.none:
|
while a =? int.none:
|
||||||
check false
|
fail
|
||||||
break
|
break
|
||||||
|
|
||||||
test "=? can appear multiple times in conditional expression":
|
test "=? can appear multiple times in conditional expression":
|
||||||
@ -67,7 +67,7 @@ suite "optionals":
|
|||||||
check a == 42
|
check a == 42
|
||||||
check b == "foo"
|
check b == "foo"
|
||||||
else:
|
else:
|
||||||
check false
|
fail
|
||||||
|
|
||||||
test "=? works with variable hiding":
|
test "=? works with variable hiding":
|
||||||
let a = 42.some
|
let a = 42.some
|
||||||
|
|||||||
@ -51,19 +51,19 @@ suite "result":
|
|||||||
|
|
||||||
test "=? can be used for optional binding":
|
test "=? can be used for optional binding":
|
||||||
if a =? int.failure(error):
|
if a =? int.failure(error):
|
||||||
check false
|
fail
|
||||||
|
|
||||||
if b =? 42.success:
|
if b =? 42.success:
|
||||||
check b == 42
|
check b == 42
|
||||||
else:
|
else:
|
||||||
check false
|
fail
|
||||||
|
|
||||||
while a =? 42.success:
|
while a =? 42.success:
|
||||||
check a == 42
|
check a == 42
|
||||||
break
|
break
|
||||||
|
|
||||||
while a =? int.failure(error):
|
while a =? int.failure(error):
|
||||||
check false
|
fail
|
||||||
break
|
break
|
||||||
|
|
||||||
test "=? can appear multiple times in conditional expression":
|
test "=? can appear multiple times in conditional expression":
|
||||||
@ -71,7 +71,7 @@ suite "result":
|
|||||||
check a == 42
|
check a == 42
|
||||||
check b == "foo"
|
check b == "foo"
|
||||||
else:
|
else:
|
||||||
check false
|
fail
|
||||||
|
|
||||||
test "=? works with variable hiding":
|
test "=? works with variable hiding":
|
||||||
let a = 42.success
|
let a = 42.success
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user