shithub: mc

Download patch

ref: 16fb3943b8f4d15b91b133f01678d04793d0d138
parent: 8c05ff6402cfb8988424b10ce3846f6d270919fd
author: Andrew Chambers <andrewchamberss@gmail.com>
date: Sat Feb 27 05:00:40 EST 2016

give tests some love

--- /dev/null
+++ b/test/destructuretup.myr
@@ -1,0 +1,7 @@
+use std
+
+const main = {
+    var a,b
+    ((a, b), _) = ((1, 2), 3)
+    std.assert(a+b == 3, "fail\n")
+}
--- /dev/null
+++ b/test/fmtalign.myr
@@ -1,0 +1,17 @@
+use std
+
+pkg = 
+    type msg = union
+        `Tversion   tversion
+    ;;
+    type tversion = struct
+        tag : uint16
+        version : byte[:]
+    ;;
+;;
+
+const main = {
+    var msg=`Tversion [.tag=45, .version="9P2000"]
+    std.fmt("{}\n", msg)
+}
+
--- a/test/genericchain.myr
+++ b/test/genericchain.myr
@@ -12,5 +12,5 @@
 }
 
 const main = {
-	std.put("val = %i\n", try(fail(123)))
+	std.put("val = {}\n", try(fail(123)))
 }
--- /dev/null
+++ b/test/initializer.myr
@@ -1,0 +1,18 @@
+use std
+
+pkg =
+    type qid = struct
+        ty  : uint8
+        path    : uint64
+    ;;
+
+    type stat = struct
+        dev : uint32
+        qid : qid
+    ;;
+;;
+
+const main = {
+    var stat : stat = [.dev=0, .qid=[.ty=0, .path=0]]
+    std.assert(stat.qid.path == 0, "fail\n")
+}
--- /dev/null
+++ b/test/nestedgoto.myr
@@ -1,0 +1,13 @@
+use std
+
+const main = {
+    match 0
+    | 0:
+        goto ok
+    | 1:
+        :ok
+        -> void
+    | _:
+    ;;
+    std.exit(1)
+}
--- a/test/tests
+++ b/test/tests
@@ -96,7 +96,7 @@
 B genericimpl	P	'int string @a @a[:]'
 B recgeneric	P	'built'
 B bigtyblob	P	'`U100 '
-# B genericchain	P	'val = 123' ## BUGGERED
+B genericchain	P	'val = 123'
 B genericmake	P	'val = 123'
 B genericuret	E	42
 B sizeof	E	4
@@ -138,10 +138,10 @@
 B strfind	C
 B strjoin	C
 B exporttrait
-# B local-labels	E	10 ## BUGGERED
+B local-labels	E	10
 F declmismatch
 F infermismatch
-# F usedef      ## BUGGERED
+F usedef
 F occur
 F tyoccur
 F union-extraarg
@@ -155,3 +155,8 @@
 B foroptexpr	P	pass
 B bounds	E	134
 B rvaldotlen	P	pass
+B destructuretup	E	0
+B nestedgoto	E	0
+B initializer	E	0
+B fmtalign	E	0
+
--- a/test/usedef.myr
+++ b/test/usedef.myr
@@ -1,3 +1,5 @@
+use std
+
 /*
 should fail to compile because 'a' is used
 before it is defined.