diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-07-01 12:30:22 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-07-01 12:30:22 -0400 |
| commit | 7dc8189266d8f235b4b7f645e427e15b14a35fd8 (patch) | |
| tree | d8b518ccc15d846e688e0e38b9bf9c4366dee81b /test | |
| parent | 37a7beb28f4b69ffaefe7f701a9902e20b721e97 (diff) | |
Add test for optionals
Diffstat (limited to 'test')
| -rw-r--r-- | test/optionals.tm | 15 |
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 |
