shithub: mc

Download patch

ref: dc770912d92c085a51d5cf3522d136c3f25e1128
parent: 21b91ad9fa7ae830272dc67fbe3150dc30921702
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Jun 12 10:23:34 EDT 2015

Unbork tests run by mbld.

--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@
 
 check: all
 	./mbldwrap.sh test:runtest
-	# BORKED. ./mbldwrap.sh test
+	./mbldwrap.sh test
 
 bench: all
 	$(MAKE) -C bench bench
--- a/libstd/test/bigint.myr
+++ b/libstd/test/bigint.myr
@@ -1,15 +1,5 @@
-use "bigint.use"
+use std
 
-/* suport libs */
-use "alloc.use"
-use "die.use"
-use "extremum.use"
-use "fmt.use"
-use "mk.use"
-use "option.use"
-use "slpush.use"
-use "sleq.use"
-
 type cmd = union
 	`Add (cmd#, cmd#)
 	`Sub (cmd#, cmd#)
@@ -99,7 +89,7 @@
 	v = eval(e)
 	n = std.bigbfmt(buf[:], v, 0)
 	if !std.sleq(buf[:n], res)
-		std.fatal(1, "%s != %s\n", buf[:n], res)
+		std.fatal("%s != %s\n", buf[:n], res)
 	;;
 }
 
--- a/libstd/test/chartype.myr
+++ b/libstd/test/chartype.myr
@@ -1,6 +1,4 @@
-use "chartype.use"
-
-use "die.use"
+use std
 
 const main = {
 	std.assert(std.isalpha('a'), "a should be alpha\n")
--- a/libstd/test/fmt.myr
+++ b/libstd/test/fmt.myr
@@ -5,13 +5,14 @@
 	var sl, ap
 
 	ap = std.vastart(&args)
-	sl = std.bfmtv(buf[:], fmt, ap)
+	sl = std.bfmtv(buf[:], fmt, &ap)
 	if !std.sleq(expected, sl)
-		std.fatal(1, "mismatched expected fmt \"%s\", expected \"%s\"\n", sl, expected)
+		std.fatal("mismatched expected fmt \"{}\", expected \"{}\"\n", sl, expected)
 	;;
 }
 
 const main = {
+	/* FIXME: make these equivalents tested.
 	check("      abcd", "%10s", "abcd")
 	check("00000bdcae", "%010s", "bdcae")
 	check("abcdefghijkl", "%010s", "abcdefghijkl")
@@ -24,5 +25,10 @@
 	check("100000"    , "%3i", 100000)
 	check("foobarbaz", "%sbar%s", "foo", "baz")
 	check("%sbarbaz", "%%sbar%s", "baz")
+	*/
+	check("abcd", "{}", "abcd")
+	check("123", "{}", 123)
+	check("7b", "{x}", 123)
+	check("0x7b", "0x{x}", 123)
 }
 
--- a/libstd/test/pathjoin.myr
+++ b/libstd/test/pathjoin.myr
@@ -49,7 +49,7 @@
 
 	p = std.pathnorm(a)
 	if !std.sleq(p, b)
-		std.fatal(1, "mismatched paths: '%s' => '%s' != '%s'\n", a, p, b)
+		std.fatal("mismatched paths: '{}' => '{}' != '{}'\n", a, p, b)
 	;;
 	std.slfree(p)
 }
@@ -56,6 +56,6 @@
 
 const eq = {a, b
 	if !std.sleq(a, b)
-		std.fatal(1, "mismatched paths: '%s' != '%s'\n", a, b)
+		std.fatal("mismatched paths: '{}' != '{}'\n", a, b)
 	;;
 }
--- a/libstd/test/search.myr
+++ b/libstd/test/search.myr
@@ -19,15 +19,15 @@
 	match a
 	| `std.None:
 		match b
-		| `std.Some x: std.fatal(1, "Expected `std.None, `std.None, got `std.None, `std.Some %i\n", x)
+		| `std.Some x: std.fatal("Expected `std.None, `std.None, got `std.None, `std.Some %i\n", x)
 		| `std.None:	/* nothing */
 		;;
 	| `std.Some x:
 		match b
-		| `std.None: std.fatal(1, "Expected `std.Some %i, `std.Some %i, got `std.Some %i, `std.None\n", x, x, x)
+		| `std.None: std.fatal("Expected `std.Some %i, `std.Some %i, got `std.Some %i, `std.None\n", x, x, x)
 		| `std.Some y: 
 			if x != y
-				std.fatal(1, "Expected `std.Some %i, `std.Some %i, got `std.Some %i, `std.Some %i\n", x, x, x, y)
+				std.fatal("Expected `std.Some %i, `std.Some %i, got `std.Some %i, `std.Some %i\n", x, x, x, y)
 			;;
 		;;
 	;;
--- a/libstd/test/slcp.myr
+++ b/libstd/test/slcp.myr
@@ -1,7 +1,4 @@
-use "slcp.use"
-
-use "die.use"
-use "sleq.use"
+use std
 
 const main = {
 	var a = [1,2,3,4,5]
--- a/libstd/test/sort.myr
+++ b/libstd/test/sort.myr
@@ -1,9 +1,4 @@
-use "sort.use"
-
-use "fmt.use"
-use "die.use"
-use "sleq.use"
-use "cmp.use"
+use std
 
 const main = {
 	var i
--- a/libstd/test/try.myr
+++ b/libstd/test/try.myr
@@ -1,8 +1,4 @@
-use "try.use"
-
-use "die.use"
-use "option.use"
-use "fmt.use"
+use std
 
 const main = {
 	var x = `std.Some 123
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -75,7 +75,7 @@
 			tt = [
 				.name = bin,
 				.dir = targ.dir,
-				.inputs = [path, s][:],
+				.inputs = [path][:],
 				.install = false,
 				.libdeps = targ.libdeps,
 				.incpath = targ.incpath,
@@ -96,6 +96,7 @@
 		std.slfree(t)
 	;;
 	std.slfree(tests)
+	std.put("test {}: {}\n", targ.name, ok)
 	-> ok
 }