shithub: mc

Download patch

ref: c4b85bb8c16c1a80775985774aabda635b43d694
parent: bc9013256fb5a406c53829fe6d4cad8325243347
author: Ori Bernstein <[email protected]>
date: Tue Jan 7 06:34:39 EST 2014

Add test for constant slices off of arrays.

--- /dev/null
+++ b/test/constslice.myr
@@ -1,0 +1,12 @@
+use std
+
+const sl = array[1:3]
+const array = [1,2,3,4,5]
+
+const main = {
+	/* expected output 23 */
+	for x in sl
+		std.put("%i\n", x)
+	;;
+	std.put("\n")
+}
--- a/test/tests
+++ b/test/tests
@@ -41,7 +41,8 @@
 B structasn	E	42
 B structarray	E	42
 B structret	E	42
-B exportmain    E       42
+B constslice	P	23
+B exportmain	E	42
 B slalloc	E	123
 B neststruct	E	3
 B array		E	7