aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-15 16:29:45 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-15 16:29:45 -0400
commitfb37b0ee4253651cab10b41cc2e1f536b17b26d4 (patch)
tree30942d2d3d8f5781fffcc0d35733b698bbd43b14 /test
parent2b454d1408846fe8ea31c3dce1551d8ebffa8d0d (diff)
Fix up `if var := ...:` in ternary expressions and optional checking
logic
Diffstat (limited to 'test')
-rw-r--r--test/optionals.tm28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/optionals.tm b/test/optionals.tm
index 6d7db835..ced42274 100644
--- a/test/optionals.tm
+++ b/test/optionals.tm
@@ -284,3 +284,31 @@ func main():
= {!Int}
>> [5?, !Int, !Int, 6?]:sorted()
= [!Int, !Int, 5?, 6?]
+
+ do:
+ >> value := if var := 5?:
+ var
+ else:
+ 0
+ = 5
+
+ do:
+ >> value := if var := !Int:
+ var
+ else:
+ 0
+ = 0
+
+ do:
+ >> opt := 5?
+ >> if opt:
+ >> opt
+ else:
+ >> opt
+
+ do:
+ >> opt := !Int
+ >> if opt:
+ >> opt
+ else:
+ >> opt