aboutsummaryrefslogtreecommitdiff
path: root/tests.snug
diff options
context:
space:
mode:
Diffstat (limited to 'tests.snug')
-rw-r--r--tests.snug6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests.snug b/tests.snug
index 698e71f..bf87448 100644
--- a/tests.snug
+++ b/tests.snug
@@ -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)")