aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-07-01 12:30:22 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-07-01 12:30:22 -0400
commit7dc8189266d8f235b4b7f645e427e15b14a35fd8 (patch)
treed8b518ccc15d846e688e0e38b9bf9c4366dee81b /test
parent37a7beb28f4b69ffaefe7f701a9902e20b721e97 (diff)
Add test for optionals
Diffstat (limited to 'test')
-rw-r--r--test/optionals.tm15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/optionals.tm b/test/optionals.tm
new file mode 100644
index 00000000..5f6fb78a
--- /dev/null
+++ b/test/optionals.tm
@@ -0,0 +1,15 @@
+
+func main():
+ >> opt := @5?
+ when opt is @nonnull:
+ >> nonnull[]
+ = 5
+ else:
+ fail("Oops")
+
+ >> opt = !@Int
+ when opt is @nonnull:
+ fail("Oops")
+ else:
+ >> opt
+ = !Int