diff options
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)") |