summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-24 23:02:36 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-24 23:02:36 -0800
commita8935c73459f261ab58b80d4c3936910181813cd (patch)
tree2d922641146264498765ab9b5e1e9a9ec320583d /test
parenta0697ff99ca952c46320707b2532bf1459078f56 (diff)
downloadmc-a8935c73459f261ab58b80d4c3936910181813cd.tar.gz
Add pointer match syntax.
Diffstat (limited to 'test')
-rw-r--r--test/matchptr.myr13
-rw-r--r--test/tests1
2 files changed, 14 insertions, 0 deletions
diff --git a/test/matchptr.myr b/test/matchptr.myr
new file mode 100644
index 0000000..f7f2f8b
--- /dev/null
+++ b/test/matchptr.myr
@@ -0,0 +1,13 @@
+use std
+
+const main = {
+ var x : std.option(std.option(int)#)
+
+ x = `std.Some &(`std.Some 123)
+ match x
+ | `std.Some &(`std.None): std.put("failed\n")
+ | `std.Some &(`std.Some 666): std.put("failed\n")
+ | `std.Some &(`std.Some 123): std.put("worked\n")
+ | _: std.put("failed\n")
+ ;;
+}
diff --git a/test/tests b/test/tests
index 0fab161..6222c6a 100644
--- a/test/tests
+++ b/test/tests
@@ -114,6 +114,7 @@ B matchexhaust P worked
B matchargstr C
B matchunion_sl P foo
B matchbind E 8
+B matchptr P 'worked'
F matchmixed
B bigliteral P 34359738368
B arraylit-ni E 2