Rename to op

This commit is contained in:
2020-07-01 22:37:19 +02:00
parent 7884ca4a8f
commit 1783232b8e
4 changed files with 22 additions and 24 deletions

View File

@@ -1,18 +1,18 @@
# To run these tests, simply execute `nimble test`.
import unittest
import oi
import op
test "Check OK":
let test = ok 1
check test.isOk == true
test "Check fail":
let test = oi.fail[int] "no data here"
let test = op.fail[int] "no data here"
check test.isOk == false
test "Check proc results":
proc createValue: OI[string] =
proc createValue: OP[string] =
let myString = "This is test code!"
ok myString
let data = createValue()
@@ -20,7 +20,7 @@ test "Check proc results":
check data.val == "This is test code!"
test "Check failing proc":
proc destinedToFail(): OI[int] =
proc destinedToFail(): OP[int] =
result.fail "no data found"
let data = destinedToFail()
@@ -28,7 +28,7 @@ test "Check failing proc":
check data.error == "no data found"
test "Check changing result":
proc checker(): OI[int] =
proc checker(): OP[int] =
result = ok 42
# something happend here
result = result.fail "data got corrupted"