mirror of
https://github.com/logos-storage/questionable.git
synced 2026-01-05 23:33:12 +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(int.none)
|
||||||
someProc(42.some)
|
someProc(42.some)
|
||||||
|
|
||||||
|
# generics
|
||||||
|
|
||||||
|
proc genericProc[T](option: ?T) =
|
||||||
|
if value =? option:
|
||||||
|
mixin value
|
||||||
|
check value == 42
|
||||||
|
|
||||||
|
genericProc(42.some)
|
||||||
|
|
||||||
# Option chaining
|
# Option chaining
|
||||||
|
|
||||||
var numbers: ?seq[int]
|
var numbers: ?seq[int]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user