test: prove ordinary import binding modes
This commit is contained in:
@@ -28,25 +28,25 @@ fn fstreq(a: str, b: str) bool = {
|
||||
};
|
||||
|
||||
fn chk(n: f64, want: str) bool = {
|
||||
return fstreq(f64tos(n), want);
|
||||
return fstreq(strconv.f64tos(n), want);
|
||||
};
|
||||
|
||||
// rt64 — bit-exact round-trip: render then parse back must reproduce the
|
||||
// exact bits. The parse-back re-runs strconv's decimal slow path.
|
||||
fn rt64(x: f64) bool = {
|
||||
match (stof64(f64tos(x), base.DEC)) {
|
||||
match (strconv.stof64(strconv.f64tos(x), strconv.base.DEC)) {
|
||||
case let v: f64 => { return math.f64bits(v) == math.f64bits(x); };
|
||||
case let e: invalid => { return false; };
|
||||
case let e: overflow => { return false; };
|
||||
case let e: strconv.invalid => { return false; };
|
||||
case let e: strconv.overflow => { return false; };
|
||||
};
|
||||
return false;
|
||||
};
|
||||
|
||||
fn rt32(x: f32) bool = {
|
||||
match (stof32(f32tos(x), base.DEC)) {
|
||||
match (strconv.stof32(strconv.f32tos(x), strconv.base.DEC)) {
|
||||
case let v: f32 => { return math.f32bits(v) == math.f32bits(x); };
|
||||
case let e: invalid => { return false; };
|
||||
case let e: overflow => { return false; };
|
||||
case let e: strconv.invalid => { return false; };
|
||||
case let e: strconv.overflow => { return false; };
|
||||
};
|
||||
return false;
|
||||
};
|
||||
@@ -96,7 +96,7 @@ fn rt32(x: f32) bool = {
|
||||
};
|
||||
|
||||
fn chkf32(n: f32, want: str) bool = {
|
||||
return fstreq(f32tos(n), want);
|
||||
return fstreq(strconv.f32tos(n), want);
|
||||
};
|
||||
|
||||
// ftos_test.ha tcs G/void rows (the "pass for both f32 and f64" set) —
|
||||
|
||||
Reference in New Issue
Block a user