summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-06-12 14:23:34 -0400
committerOri Bernstein <ori@eigenstate.org>2015-06-12 14:23:34 -0400
commitdc770912d92c085a51d5cf3522d136c3f25e1128 (patch)
treedbe3107a6c36d27edce26741e03f210223b98057 /libstd
parent21b91ad9fa7ae830272dc67fbe3150dc30921702 (diff)
downloadmc-dc770912d92c085a51d5cf3522d136c3f25e1128.tar.gz
Unbork tests run by mbld.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/test/bigint.myr14
-rw-r--r--libstd/test/chartype.myr4
-rw-r--r--libstd/test/fmt.myr10
-rw-r--r--libstd/test/pathjoin.myr4
-rw-r--r--libstd/test/search.myr6
-rw-r--r--libstd/test/slcp.myr5
-rw-r--r--libstd/test/sort.myr7
-rw-r--r--libstd/test/try.myr6
8 files changed, 19 insertions, 37 deletions
diff --git a/libstd/test/bigint.myr b/libstd/test/bigint.myr
index db74732..582fe60 100644
--- a/libstd/test/bigint.myr
+++ b/libstd/test/bigint.myr
@@ -1,14 +1,4 @@
-use "bigint.use"
-
-/* 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"
+use std
type cmd = union
`Add (cmd#, cmd#)
@@ -99,7 +89,7 @@ const run = {e : cmd#, res : byte[:]
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)
;;
}
diff --git a/libstd/test/chartype.myr b/libstd/test/chartype.myr
index f77b29e..d0df1d2 100644
--- 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")
diff --git a/libstd/test/fmt.myr b/libstd/test/fmt.myr
index c51c3cc..15522af 100644
--- a/libstd/test/fmt.myr
+++ b/libstd/test/fmt.myr
@@ -5,13 +5,14 @@ const check = {expected, fmt, args : ...
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 @@ const main = {
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)
}
diff --git a/libstd/test/pathjoin.myr b/libstd/test/pathjoin.myr
index 18e313d..9cdc064 100644
--- a/libstd/test/pathjoin.myr
+++ b/libstd/test/pathjoin.myr
@@ -49,13 +49,13 @@ const norm = {a, b
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)
}
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)
;;
}
diff --git a/libstd/test/search.myr b/libstd/test/search.myr
index 3e3ac53..342a406 100644
--- a/libstd/test/search.myr
+++ b/libstd/test/search.myr
@@ -19,15 +19,15 @@ const expect = {a, b
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)
;;
;;
;;
diff --git a/libstd/test/slcp.myr b/libstd/test/slcp.myr
index 385b6ef..67c8298 100644
--- 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]
diff --git a/libstd/test/sort.myr b/libstd/test/sort.myr
index 4c6bd38..e814623 100644
--- 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
diff --git a/libstd/test/try.myr b/libstd/test/try.myr
index 7458fc4..e8eea97 100644
--- 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