mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-24 18:32:23 +00:00
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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user