diff --git a/calculator/test.js b/calculator/test.js index 41323f9..44d49e1 100644 --- a/calculator/test.js +++ b/calculator/test.js @@ -119,7 +119,12 @@ function press(buttons) { } function checkDisplay(expected, message) { - const expectedStr = String(expected); + let expectedStr = String(expected); + if (expected === Infinity) { + expectedStr = 'INF'; + } else if (expected === -Infinity) { + expectedStr = '-INF'; + } // attempt a numeric comparison for float-related issues const expectedNum = parseFloat(expectedStr.replace(/,/g, ''));