summaryrefslogtreecommitdiff
path: root/lib/std/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-11-03 10:49:27 -0700
committerOri Bernstein <ori@markovcorp.com>2017-11-14 13:50:39 -0800
commit2d00e8f657965583e906327bd4c0eff6953a71cd (patch)
tree18620db7cb82b25881675cbd1966f095399328b2 /lib/std/test
parent5d40b4ead1f20776f23bed271412af829bbe0e96 (diff)
downloadmc-2d00e8f657965583e906327bd4c0eff6953a71cd.tar.gz
Rename comparable => equatable
Diffstat (limited to 'lib/std/test')
-rw-r--r--lib/std/test/hashfuncs.myr12
-rw-r--r--lib/std/test/htab.myr4
-rw-r--r--lib/std/test/striter.myr2
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/std/test/hashfuncs.myr b/lib/std/test/hashfuncs.myr
index 5813663..35cf20c 100644
--- a/lib/std/test/hashfuncs.myr
+++ b/lib/std/test/hashfuncs.myr
@@ -5,19 +5,19 @@ const main = {
testr.run([
[.name="string hash and equality", .fn={ctx
testr.check(ctx, std.hash("abc") == 0x5dbcfa53aa2007a5, "wrong hash\n")
- testr.check(ctx, std.cmp("abc\0def", "abc\0def"), "equal strings not equal\n")
- testr.check(ctx, !std.cmp("abc\0def", "abcdef"), "unequal strings are equal\n")
+ testr.check(ctx, std.eq("abc\0def", "abc\0def"), "equal strings not equal\n")
+ testr.check(ctx, !std.eq("abc\0def", "abcdef"), "unequal strings are equal\n")
}],
[.name="pointer equality", .fn={ctx
var x, y: int
/* can't sanely test ptrhash; it will change every time */
- testr.check(ctx, std.cmp(&x, &x), "equal pointers not equal")
- testr.check(ctx, !std.cmp(&x, &y), "unequal pointers are equal")
+ testr.check(ctx, std.eq(&x, &x), "equal pointers not equal")
+ testr.check(ctx, !std.eq(&x, &y), "unequal pointers are equal")
}],
[.name="int hash and equality", .fn={ctx
testr.check(ctx, std.hash(123) == 0x5671db246859d5b6, "wrong int hash")
- testr.check(ctx, std.cmp(123, 123), "equal integers not equal")
- testr.check(ctx, !std.cmp(123, 456), "unequal integers are equal")
+ testr.check(ctx, std.eq(123, 123), "equal integers not equal")
+ testr.check(ctx, !std.eq(123, 456), "unequal integers are equal")
}],
[.name="siphash test", .fn={ctx
siphashreferencetestvector(ctx)
diff --git a/lib/std/test/htab.myr b/lib/std/test/htab.myr
index b2612c4..16040f0 100644
--- a/lib/std/test/htab.myr
+++ b/lib/std/test/htab.myr
@@ -103,8 +103,8 @@ impl std.hashable collisionprone =
}
;;
-impl std.comparable collisionprone =
- cmp = {a, b
+impl std.equatable collisionprone =
+ eq = {a, b
-> a == b
}
;;
diff --git a/lib/std/test/striter.myr b/lib/std/test/striter.myr
index 8a4397e..b54e580 100644
--- a/lib/std/test/striter.myr
+++ b/lib/std/test/striter.myr
@@ -13,7 +13,7 @@ const main = {
i = 0
for sp : std.bysplit("foo+++bar", "++")
- std.assert(std.cmp(splits[i++], sp), "wrong split {}", sp)
+ std.assert(std.eq(splits[i++], sp), "wrong split {}", sp)
;;
std.assert(i == splits.len, "wrong split count")
}