Failing Test Requiring Too Much Precision (#2647)

The new array tests for IMCSC fail on my system because of a rounding error in the 14th (!) decimal position. This is not a real failure. Change the test to use only the first 8 decimal positions.
This commit is contained in:
oleibman 2022-03-04 00:11:04 -08:00 committed by GitHub
parent a7a48bf0ca
commit e87be5e16d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -52,6 +52,18 @@ class ImCscTest extends TestCase
$formula = "=IMCSC({$complex})";
$result = $calculation->_calculateFormulaValue($formula);
// Avoid testing for excess precision
foreach ($expectedResult as &$array) {
foreach ($array as &$string) {
$string = preg_replace('/(\\d{8})\\d+/', '$1', $string);
}
}
foreach ($result as &$array) {
foreach ($array as &$string) {
$string = preg_replace('/(\\d{8})\\d+/', '$1', $string);
}
}
self::assertEquals($expectedResult, $result);
}