Add alias for "fail"
This commit is contained in:
@@ -19,7 +19,7 @@ test "Check proc results":
|
||||
check data.isOk
|
||||
check data.val == "This is test code!"
|
||||
|
||||
test "Check failing proc":
|
||||
test "Check failing result proc":
|
||||
proc someProc(): OP[int] =
|
||||
result.fail "Not implemented!"
|
||||
|
||||
@@ -27,6 +27,22 @@ test "Check failing proc":
|
||||
assert data.isOk == false
|
||||
assert data.error == "Not implemented!"
|
||||
|
||||
test "Check failing typedesc proc ":
|
||||
proc someProc(): OP[int] =
|
||||
fail(int, "Not implemented!")
|
||||
|
||||
let data = someProc()
|
||||
assert data.isOk == false
|
||||
assert data.error == "Not implemented!"
|
||||
|
||||
test "Check failing type param proc ":
|
||||
proc someProc(): OP[int] =
|
||||
op.fail[int]("Not implemented!")
|
||||
|
||||
let data = someProc()
|
||||
assert data.isOk == false
|
||||
assert data.error == "Not implemented!"
|
||||
|
||||
test "Check changing result":
|
||||
proc checker(): OP[int] =
|
||||
result = ok 42
|
||||
|
||||
Reference in New Issue
Block a user