Scripts: the large km to mi test checks the converted value

The expected value multiplied 1e307 by 1000 before dividing, which
overflows to infinity, so the closeness check accepted any finite
result. The expected value now divides the factors first.
This commit is contained in:
dotCooCoo
2026-11-21 21:04:03 -08:00
parent 7e5b421db2
commit 47840d28e3
+1 -1
View File
@@ -323,7 +323,7 @@ fn results_that_are_not_finite_and_division_by_zero_throw() {
assert_eq!(error_name(&mut r, statement), "RangeError", "{statement}");
}
assert_eq!(number(&mut r, "UnitValue(1e300, 'pt').as('mi') * 0"), 0.0);
close(number(&mut r, "UnitValue(1e307, 'km').as('mi')"), 1e307 * 1000.0 / 1609.344, "a large value that fits after the division");
close(number(&mut r, "UnitValue(1e307, 'km').as('mi')"), 1e307 * (1000.0 / 1609.344), "a large value that fits after the division");
}
#[test]