Add test for optionals

This commit is contained in:
Bruce Hill 2024-07-01 12:30:22 -04:00
parent 37a7beb28f
commit 7dc8189266

15
test/optionals.tm Normal file
View File

@ -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