shithub: mc

Download patch

ref: cc1be5641df28864deb468d47577be35a25e0c03
parent: fb88daaedf549fd7e232c7c44d7b37e5f11ec4fc
author: Ori Bernstein <[email protected]>
date: Thu Dec 25 17:20:50 EST 2014

Fix the rc script up.

--- a/parse/type.c
+++ b/parse/type.c
@@ -776,7 +776,7 @@
             }
             break;
         case Tytuple:
-            p += snprintf(p, end - p, "$p");
+            p += snprintf(p, end - p, "$e");
             for (i = 0; i < ty->nsub; i++) {
                 p += tyidfmt(p, end - p, ty->sub[i]);
             }
@@ -793,7 +793,7 @@
         case Tyunion:
             p += snprintf(p, end - p, "$u");
             for (i = 0; i < ty->nmemb; i++) {
-                p += snprintf(p, end - p, "%s.", namestr(ty->udecls[i]->name));
+                p += snprintf(p, end - p, "%s$", namestr(ty->udecls[i]->name));
                 if (ty->udecls[i]->etype)
                     p += tyidfmt(p, end - p, ty->udecls[i]->etype);
                 p += snprintf(p, end - p, "$");
@@ -800,7 +800,7 @@
             }
             break;
         case Typaram:
-            p += snprintf(p, end - p, "$p");
+            p += snprintf(p, end - p, "$r");
             p += tyidfmt(p, end - p, ty->sub[0]);
             break;
         case Tyunres:
--- a/test/runtest.rc
+++ b/test/runtest.rc
@@ -10,12 +10,12 @@
 }
 
 fn pass {
-	passed=$passed ^ " " ^ $1
+	passed=$passed ^ ' ' ^ $1
 }
 
 fn fail {
 	echo FAIL: $1
-	failed=$failed ^ " " ^ $1
+	failed=$failed ^ ' ' ^ $1
 }
 
 fn expectstatus {
@@ -30,7 +30,7 @@
 }
 
 fn expectprint {
-	if(~ "`{./$1 $3}" "$2")
+	if(~ `{./$1 $3} $2)
 		pass $1
 	if not
 		fail $1
@@ -37,7 +37,7 @@
 }
 
 fn expectcmp {
-	t="/tmp/myrtest-$1"
+	t=/tmp/myrtest-^$1
 	rm -f $t
 	./$1 $3 > $t
 	if (cmp $t data/$1-expected)
@@ -47,7 +47,7 @@
 }
 
 fn expectfcmp {
-	t="/tmp/myrtest-$1"
+	t=/tmp/myrtest-^$1
 	rm -f $t
 	./$1 $3
 	if (cmp $2 data/$1-expected)
@@ -63,13 +63,13 @@
 
 	build $test
 	switch($type) {
-	case "E"
-		expectstatus $test $res
-	case "P"
-		expectprint $test $res
-	case "C"
-		expectcmp $test $res
-	case "F"
+	case E
+	      expectstatus $test $res
+	case P
+	      expectprint $test $res
+	case C
+	      expectcmp $test $res
+	case F
 		expectfcmp $test $res
 	}
 }
@@ -85,10 +85,10 @@
 
 . tests
 
-echo "PASSED $passed"
+echo PASSED ^ " " ^ $passed
 if(~ $failed "")
 	echo SUCCESS
 if not
-	echo "FAILURES $failed"
+	echo FAILURES ^ " " ^ $failed