mirror of
https://github.com/logos-storage/questionable.git
synced 2026-01-02 22:03:10 +00:00
Add missing test from readme
This commit is contained in:
parent
ef5f796463
commit
a8834aea66
@ -230,6 +230,15 @@ suite "optionals":
|
||||
someProc(int.none)
|
||||
someProc(42.some)
|
||||
|
||||
# generics
|
||||
|
||||
proc genericProc[T](option: ?T) =
|
||||
if value =? option:
|
||||
mixin value
|
||||
check value == 42
|
||||
|
||||
genericProc(42.some)
|
||||
|
||||
# Option chaining
|
||||
|
||||
var numbers: ?seq[int]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user