ref: 05666a778aae28f2f647f22ef566f041b5bf08c7
parent: b120745ab31e2b6a061b97c20e40ff643e2c867b
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Nov 9 17:27:30 EST 2016
Shit, committed wrong version.
--- a/lib/std/test/fltparse.myr
+++ b/lib/std/test/fltparse.myr
@@ -2,6 +2,8 @@
use testr
const main = {
+ var si
+
testr.run([
/* 64 bit tests */
[.name="flt64-intzero", .fn={ctx; is64(ctx, "0", 0.0)}],
@@ -15,17 +17,6 @@
[.name="flt64-toobig", .fn={ctx; is64(ctx, "17.976931348623157e308", std.flt64inf())}],
[.name="flt64-exptoobig", .fn={ctx; is64(ctx, "1.7976931348623157e309", std.flt64inf())}],
- /*
- skip the test for denormalized values on 9front; the APE float parser returns denormalized
- values as 0, which means that we get a spurious failure.
- */
- std.getsysinfo(&si)
- match si.system
- | "Plan9":
- | _:
- [.name="flt64-denorm", .fn={ctx; is64(ctx, "2.2250738585072014e-311", 2.2250738585072014e-311)}],
- ;;
-
/* 32 bit tests */
[.name="flt32-intzero", .fn={ctx; is32(ctx, "0", 0.0)}],
[.name="flt32-floatzero", .fn={ctx; is32(ctx, "0.0", 0.0)}],
@@ -42,6 +33,19 @@
[.name="badfmt-twodot", .fn={ctx; isjunk(ctx, "1.2.3")}],
[.name="badfmt-badexp", .fn={ctx; isjunk(ctx, "1.2ee3")}],
][:])
+
+ /*
+ skip the test for denormalized values on 9front; the APE float parser returns denormalized
+ values as 0, which means that we get a spurious failure.
+ */
+ std.getsysinfo(&si)
+ match si.system
+ | "Plan9":
+ | _:
+ testr.run([
+ [.name="flt64-denorm", .fn={ctx; is64(ctx, "2.2250738585072014e-311", 2.2250738585072014e-311)}],
+ ][:])
+ ;;
}
const is64 = {ctx, str, val