summaryrefslogtreecommitdiff
path: root/lib/std/test
diff options
context:
space:
mode:
authorS. Gilles <sgilles@math.umd.edu>2019-05-10 16:43:57 -0400
committerOri Bernstein <ori@eigenstate.org>2019-05-10 16:27:20 -0700
commitfd333ef7321e70c49b97d9ffb47805fe686e5d05 (patch)
treecae56182efbdee6c696a15a100cdbf3a23108b8a /lib/std/test
parentcec2ed10f355e59322f3d148837dca47aab083a6 (diff)
downloadmc-fd333ef7321e70c49b97d9ffb47805fe686e5d05.tar.gz
Allow exact case of mkbigint(2^32)
Diffstat (limited to 'lib/std/test')
-rw-r--r--lib/std/test/bigint.myr6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/std/test/bigint.myr b/lib/std/test/bigint.myr
index 2467143..c87f1f3 100644
--- a/lib/std/test/bigint.myr
+++ b/lib/std/test/bigint.myr
@@ -27,7 +27,7 @@ const main = {
}
const smoketest = {ct
- var a, b, c, d, e
+ var a, b, c, d, e, f
var buf : byte[64], n
/* a few combined ops */
@@ -36,6 +36,7 @@ const smoketest = {ct
c = std.mkbigint(7919)
d = std.mkbigint(113051)
e = std.mkbigint(11)
+ f = std.mkbigint((4294967296 : int64))
std.bigmul(a, b)
std.bigmul(a, b)
@@ -50,6 +51,9 @@ const smoketest = {ct
n = std.bigbfmt(buf[:], a, 0)
testr.check(ct, std.eq(buf[:n], "517347321949036993306"), "simple smoke test failed")
+
+ n = std.bigbfmt(buf[:], f, 0)
+ testr.check(ct, std.eq(buf[:n], "4294967296"), "smoke test failed for 2^32 case")
}
const matchsmall = {c