From 47840d28e3a2ec9af5a3694f6d89c1f66ad825fa Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 21:04:03 -0800 Subject: [PATCH] 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. --- crates/js/src/unit_value_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/js/src/unit_value_tests.rs b/crates/js/src/unit_value_tests.rs index d7f3a642e8..79056df064 100644 --- a/crates/js/src/unit_value_tests.rs +++ b/crates/js/src/unit_value_tests.rs @@ -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]