summaryrefslogtreecommitdiff
path: root/lib/std/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2018-01-27 12:22:19 -0800
committerOri Bernstein <ori@markovcorp.com>2018-01-27 12:23:36 -0800
commit4c94aae21c2c2aec19d4fd5871cfe92bc09303a7 (patch)
treeb7c773a2274cb3b3ee46d9e90d54a3b6c4ddce37 /lib/std/test
parentdbe9ae0f9dbed30d40952261384b4673766d83ca (diff)
downloadmc-4c94aae21c2c2aec19d4fd5871cfe92bc09303a7.tar.gz
Remove std.sleq
We have std.eq. We still export a generic sleq for compatibility, but we don't need it or want it.
Diffstat (limited to 'lib/std/test')
-rw-r--r--lib/std/test/bigint.myr4
-rw-r--r--lib/std/test/chomp.myr2
-rw-r--r--lib/std/test/dirname.myr2
-rw-r--r--lib/std/test/fmt.myr2
-rw-r--r--lib/std/test/ipparse.myr2
-rw-r--r--lib/std/test/netaddr.myr2
-rw-r--r--lib/std/test/pathjoin.myr4
-rw-r--r--lib/std/test/slcp.myr6
-rw-r--r--lib/std/test/sleq.myr10
-rw-r--r--lib/std/test/sort.myr6
-rw-r--r--lib/std/test/strbuf.myr26
-rw-r--r--lib/std/test/strsplit.myr2
12 files changed, 34 insertions, 34 deletions
diff --git a/lib/std/test/bigint.myr b/lib/std/test/bigint.myr
index ba8eaa1..33e1b91 100644
--- a/lib/std/test/bigint.myr
+++ b/lib/std/test/bigint.myr
@@ -35,7 +35,7 @@ const main = {
std.bigfree(e)
n = std.bigbfmt(buf[:], a, 0)
- std.assert(std.sleq(buf[:n], "517347321949036993306"), "simple smoke test failed")
+ std.assert(std.eq(buf[:n], "517347321949036993306"), "simple smoke test failed")
/* some comparison tests */
a = try(std.bigparse("1234_5678_1234_6789_6666_7777_8888"))
@@ -119,7 +119,7 @@ const run = {e : cmd#, res : byte[:]
v = eval(e)
n = std.bigbfmt(buf[:], v, 0)
- if !std.sleq(buf[:n], res)
+ if !std.eq(buf[:n], res)
std.fatal("{} != {}\n", buf[:n], res)
;;
}
diff --git a/lib/std/test/chomp.myr b/lib/std/test/chomp.myr
index 6bc9aa5..1816012 100644
--- a/lib/std/test/chomp.myr
+++ b/lib/std/test/chomp.myr
@@ -11,6 +11,6 @@ const check = {sl, pfx, expected
r = sl
std.chomp(&r, pfx)
- std.assert(std.sleq(r, expected), \
+ std.assert(std.eq(r, expected), \
"expected chomp({}, {}) => {}, got {}\n", sl, pfx, expected, r)
}
diff --git a/lib/std/test/dirname.myr b/lib/std/test/dirname.myr
index 8930f46..6795ec0 100644
--- a/lib/std/test/dirname.myr
+++ b/lib/std/test/dirname.myr
@@ -17,7 +17,7 @@ const main = {
}
const eq = {a, e
- if !std.sleq(e, a)
+ if !std.eq(e, a)
std.fatal("expected '{}', got '{}'\n", e, a)
;;
}
diff --git a/lib/std/test/fmt.myr b/lib/std/test/fmt.myr
index ec3fe85..da1b76a 100644
--- a/lib/std/test/fmt.myr
+++ b/lib/std/test/fmt.myr
@@ -21,7 +21,7 @@ const check = {expected, fmt, args : ...
ap = std.vastart(&args)
sl = std.bfmtv(buf[:], fmt, &ap)
- if !std.sleq(expected, sl)
+ if !std.eq(expected, sl)
std.fatal("mismatched fmt: got \"{}\", expected \"{}\"\n", sl, expected)
;;
}
diff --git a/lib/std/test/ipparse.myr b/lib/std/test/ipparse.myr
index fd6140a..dfed4d6 100644
--- a/lib/std/test/ipparse.myr
+++ b/lib/std/test/ipparse.myr
@@ -66,7 +66,7 @@ const eq = {ip, expected
parsed = std.ipparse(ip)
p = ipbytes(parsed)
e = ipbytes(expected)
- if !std.sleq(p, e)
+ if !std.eq(p, e)
std.fput(1, "misparsed ip {}\n", ip)
std.put("parsed: ")
for b : p
diff --git a/lib/std/test/netaddr.myr b/lib/std/test/netaddr.myr
index fd9ab84..1d6cac0 100644
--- a/lib/std/test/netaddr.myr
+++ b/lib/std/test/netaddr.myr
@@ -16,7 +16,7 @@ const matches = {ctx, expected, addr, net, port
var s
s = std.netaddr(addr, net, port)
- testr.check(ctx, std.sleq(expected, s), \
+ testr.check(ctx, std.eq(expected, s), \
"mismatch: expected {}, got {} from ({}, {}, {})\n", \
expected, s, addr, net, port)
std.slfree(s)
diff --git a/lib/std/test/pathjoin.myr b/lib/std/test/pathjoin.myr
index 0204184..4522af7 100644
--- a/lib/std/test/pathjoin.myr
+++ b/lib/std/test/pathjoin.myr
@@ -49,14 +49,14 @@ const norm = {a, b
var p
p = std.pathnorm(a)
- if !std.sleq(p, b)
+ if !std.eq(p, b)
std.fatal("mismatched paths: '{}' => '{}' != '{}'\n", a, p, b)
;;
std.slfree(p)
}
const eq = {a, b
- if !std.sleq(a, b)
+ if !std.eq(a, b)
std.fatal("mismatched paths: '{}' != '{}'\n", a, b)
;;
}
diff --git a/lib/std/test/slcp.myr b/lib/std/test/slcp.myr
index 07381c3..edb8050 100644
--- a/lib/std/test/slcp.myr
+++ b/lib/std/test/slcp.myr
@@ -18,7 +18,7 @@ const main = {
std.slcp(a[:a.len-2], a[2:])
std.slcp(b[2:], b[:b.len-2])
std.slcp(c[1:15], c[0:14])
- std.assert(std.sleq(a[:], a_cped[:]), "slcp of a failed: got {}, wanted {}", a[:], a_cped[:])
- std.assert(std.sleq(b[:], b_cped[:]), "slcp of b failed: got {}, wanted {}", b[:], b_cped[:])
- std.assert(std.sleq(c[:], c_cped[:]), "slcp of b failed: got {r}, wanted {r}", c[:], c_cped[:])
+ std.assert(std.eq(a[:], a_cped[:]), "slcp of a failed: got {}, wanted {}", a[:], a_cped[:])
+ std.assert(std.eq(b[:], b_cped[:]), "slcp of b failed: got {}, wanted {}", b[:], b_cped[:])
+ std.assert(std.eq(c[:], c_cped[:]), "slcp of b failed: got {r}, wanted {r}", c[:], c_cped[:])
}
diff --git a/lib/std/test/sleq.myr b/lib/std/test/sleq.myr
index c15807f..e9ffb59 100644
--- a/lib/std/test/sleq.myr
+++ b/lib/std/test/sleq.myr
@@ -12,14 +12,14 @@ const main = {
const wide = {c
var a : uint[3] = [ 0, 1, 2]
var b : uint[3] = [ 0, 1, 3]
- testr.check(c, !std.sleq(a[:], b[:]), "expected {} != {} as uint[:]", a, b)
+ testr.check(c, !std.eq(a[:], b[:]), "expected {} != {} as uint[:]", a, b)
}
const slices = {c
var a : int8[8] = [ 0, 0, 3, 1, 0, 3, 1, 2 ]
var b : int8[3] = [ 1, 0, 3]
- testr.check(c, std.sleq(a[1:4], a[4:7]), "expected {} = {}", a[1:4], a[4:7])
- testr.check(c, !std.sleq(a[0:4], a[3:7]), "expected {} = {}", a[0:4], a[3:7])
- testr.check(c, !std.sleq(a[:], b[:]), "expected {} = {}", a, b)
- testr.check(c, !std.sleq(a[3:7], b[:]), "expected {} = {}", a[3:7], b)
+ testr.check(c, std.eq(a[1:4], a[4:7]), "expected {} = {}", a[1:4], a[4:7])
+ testr.check(c, !std.eq(a[0:4], a[3:7]), "expected {} = {}", a[0:4], a[3:7])
+ testr.check(c, !std.eq(a[:], b[:]), "expected {} = {}", a, b)
+ testr.check(c, !std.eq(a[3:7], b[:]), "expected {} = {}", a[3:7], b)
}
diff --git a/lib/std/test/sort.myr b/lib/std/test/sort.myr
index e814623..61e39ae 100644
--- a/lib/std/test/sort.myr
+++ b/lib/std/test/sort.myr
@@ -12,16 +12,16 @@ const main = {
/* with custom intcmp */
std.sort(a[:], intcmp)
- std.assert(std.sleq(a[:], a_sorted[:]), "a was missorted")
+ std.assert(std.eq(a[:], a_sorted[:]), "a was missorted")
/* with libstd generic numcmp */
std.sort(b[:], std.numcmp)
- std.assert(std.sleq(b[:], b_sorted[:]), "b was missorted")
+ std.assert(std.eq(b[:], b_sorted[:]), "b was missorted")
/* string sorting */
std.sort(c[:], std.strcmp)
for i = 0; i < c.len; i++
- std.assert(std.sleq(c[i], c_sorted[i]), "c was missorted")
+ std.assert(std.eq(c[i], c_sorted[i]), "c was missorted")
;;
}
diff --git a/lib/std/test/strbuf.myr b/lib/std/test/strbuf.myr
index 2643da5..741ed39 100644
--- a/lib/std/test/strbuf.myr
+++ b/lib/std/test/strbuf.myr
@@ -5,36 +5,36 @@ const main = {
var buf : byte[16]
sb = std.mksb()
- std.assert(std.sleq(std.sbpeek(sb), ""), "mismatched empty str\n")
+ std.assert(std.eq(std.sbpeek(sb), ""), "mismatched empty str\n")
std.sbputs(sb, "hello")
- std.assert(std.sleq(std.sbpeek(sb), "hello"), "mismatched hello\n")
+ std.assert(std.eq(std.sbpeek(sb), "hello"), "mismatched hello\n")
std.sbputs(sb, ", hello")
- std.assert(std.sleq(std.sbpeek(sb), "hello, hello"), "mismatched double hello\n")
+ std.assert(std.eq(std.sbpeek(sb), "hello, hello"), "mismatched double hello\n")
std.sbtrim(sb, 7)
- std.assert(std.sleq(std.sbpeek(sb), "hello, "), "mismatched trim\n")
+ std.assert(std.eq(std.sbpeek(sb), "hello, "), "mismatched trim\n")
std.sbputs(sb, "world")
- std.assert(std.sleq(std.sbpeek(sb), "hello, world"), "mismatched hello world\n")
+ std.assert(std.eq(std.sbpeek(sb), "hello, world"), "mismatched hello world\n")
std.sbtrim(sb, -5)
- std.assert(std.sleq(std.sbpeek(sb), "hello, "), "mismatched rtrim\n")
+ std.assert(std.eq(std.sbpeek(sb), "hello, "), "mismatched rtrim\n")
std.sbputc(sb, '世')
std.sbputc(sb, '界')
- std.assert(std.sleq(std.sbpeek(sb), "hello, 世界"), "mismatched unicode\n")
+ std.assert(std.eq(std.sbpeek(sb), "hello, 世界"), "mismatched unicode\n")
std.sbputb(sb, 10)
- std.assert(std.sleq(std.sbpeek(sb), "hello, 世界\n"), "mismatched byte\n")
+ std.assert(std.eq(std.sbpeek(sb), "hello, 世界\n"), "mismatched byte\n")
sb = std.mkbufsb(buf[:])
std.assert(std.sbputs(sb, "hello"), "failed to add hello\n") /* 5 characters */
std.assert(std.sbputs(sb, "hello"), "failed to add hello\n") /* 10 characters */
std.assert(std.sbputs(sb, "hello"), "failed to add hello\n") /* 15 characters */
std.assert(!std.sbputs(sb, "hello"), "erronous success\n") /* 16 characters */
- std.assert(std.sleq(std.sbpeek(sb), "hellohellohelloh"), "failed to copy as much as possible\n")
+ std.assert(std.eq(std.sbpeek(sb), "hellohellohelloh"), "failed to copy as much as possible\n")
std.sbtrim(sb, -1)
- std.assert(std.sleq(std.sbpeek(sb), "hellohellohello"), "failed rtrim\n")
+ std.assert(std.eq(std.sbpeek(sb), "hellohellohello"), "failed rtrim\n")
std.sbputc(sb, '世')
- std.assert(std.sleq(std.sbpeek(sb), "hellohellohello"), "modified overflowed putc\n")
+ std.assert(std.eq(std.sbpeek(sb), "hellohellohello"), "modified overflowed putc\n")
std.sbtrim(sb, -2)
- std.assert(std.sleq(std.sbpeek(sb), "hellohellohel"), "failed rtrim\n")
+ std.assert(std.eq(std.sbpeek(sb), "hellohellohel"), "failed rtrim\n")
std.sbputc(sb, '世')
- std.assert(std.sleq(std.sbpeek(sb), "hellohellohel世"), "failed to append with putc\n")
+ std.assert(std.eq(std.sbpeek(sb), "hellohellohel世"), "failed to append with putc\n")
}
diff --git a/lib/std/test/strsplit.myr b/lib/std/test/strsplit.myr
index c70f6f6..bf81f41 100644
--- a/lib/std/test/strsplit.myr
+++ b/lib/std/test/strsplit.myr
@@ -36,7 +36,7 @@ const check = {a, b
std.fatal("length mismatch: {} != {}: {}\n", a.len, b.len)
;;
for var i = 0; i < a.len; i++
- if !std.sleq(a[i], b[i])
+ if !std.eq(a[i], b[i])
std.fatal("element {} mismatched: '{}' != '{}'\n", i, a[i], b[i])
;;
;;