From a8834aea6698d7cef5304136a54efeec5ebaac16 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Fri, 16 Apr 2021 12:27:43 +0200 Subject: [PATCH] Add missing test from readme --- testmodules/options/test.nim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testmodules/options/test.nim b/testmodules/options/test.nim index 09932b8..db9b6a4 100644 --- a/testmodules/options/test.nim +++ b/testmodules/options/test.nim @@ -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]