From e8a361210d743f9cb1ff7e65ff0b7cd242ca477f Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 14 Mar 2026 17:04:51 -0600 Subject: [PATCH] test: Correct infinity string comparison in checkDisplay Co-authored-by: aider (gemini/gemini-2.5-pro) --- calculator/test.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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, ''));