diff options
author | Camil Staps | 2023-11-27 19:00:20 +0100 |
---|---|---|
committer | Camil Staps | 2023-11-27 19:00:20 +0100 |
commit | 5a3007ea91a3ee57a4fc3e34c0edd59a90b525c3 (patch) | |
tree | 3addc1233eb1e80657fa36b6599e3ebe3d097d88 /tests.snug | |
parent | Update to base 2.0 (diff) |
WIP on code generation for case expressions
Diffstat (limited to 'tests.snug')
-rw-r--r-- | tests.snug | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -24,3 +24,9 @@ (test "function application (const)" : Int : (const 1 (const 2 3)) "1") (test "function application (tuple)" : Tuple Int Int : (tuple 10 20) "(10,20)") (test "function application (swapped_tuple)" : Tuple Int Int : (swapped_tuple 10 20) "(20,10)") + +(fun swap ((t : Tuple Int Int)) : Tuple Int Int : + case t ( + (Tuple x y -> Tuple y x))) + +(test "pattern matching (tuple)" : Tuple Int Int : (swap (Tuple 1 2)) "(2,1)") |