Skip to content

Commit

Permalink
test ? in ok (fixes #23) (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck authored Aug 14, 2024
1 parent 410afe8 commit 0313bce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_results.nim
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,14 @@ block: # Result[T, void] aka `Opt`
doAssert oOk.value() in oOk
doAssert oOk.value() + 1 notin oOk

block: # Nested `?`
proc inside: Opt[int] =
ok(5)
proc kput: Opt[int] =
ok(? inside())

doAssert kput() == Opt.some(5)

block: # `cstring` dangling reference protection
type CSRes = Result[void, cstring]

Expand Down

0 comments on commit 0313bce

Please sign in to comment.