shithub: mc

Download patch

ref: a31dc19339a6f62ed08b8dba8cffe889350c858c
parent: dd77ee3c80c3705bdd6f82af17ee9782cc4460c3
author: Ori Bernstein <[email protected]>
date: Sat Jun 30 15:01:20 EDT 2012

Add tests for literal sequences.

--- /dev/null
+++ b/test/arraylit.myr
@@ -1,0 +1,6 @@
+const main = {
+	var a = [#0=1,
+		 #2=3,
+		 #1=2]
+	-> a[2]
+}
--- /dev/null
+++ b/test/structlit.myr
@@ -1,0 +1,13 @@
+type t = struct
+	a	: int
+	b	: char
+	c	: char[,]
+;;
+
+const main = {
+	var v : t
+
+	v = [.a=42, .b='x', .c="foo"]
+	-> v.a
+}
+
--- a/test/tests
+++ b/test/tests
@@ -1,18 +1,18 @@
 # Format:
 # [B|F] testname [E|P] result
 #    [B|F]: Compiler outcome.
-#       B: Expect that this test will build.
-#       F: Expect that this test will not build.
+#	B: Expect that this test will build.
+#	F: Expect that this test will not build.
 #    testname: Test case
-#       The test that will run. We will try to
-#       compile 'testname.myr' to 'testname',
-#       and then execute it, verifying the result
+#	The test that will run. We will try to
+#	compile 'testname.myr' to 'testname',
+#	and then execute it, verifying the result
 #    [E|P]: Result type
-#       E tells us that the result is an exit status
-#       E tells us that the result output on stdout
+#	E tells us that the result is an exit status
+#	E tells us that the result output on stdout
 #    result: Result value
-#       What we compare with. This should be self-
-#       evident.
+#	What we compare with. This should be self-
+#	evident.
 B main		E	0
 B add		E	53
 B mul		E	42
@@ -45,6 +45,8 @@
 B matchunion	E	84
 B matchargunion	E	69
 B matchbind	E	8
+B arraylit	E	3
+B structlit	E	42
 F declmismatch
 F infermismatch
 F flow