Skip to content

Commit

Permalink
Fix test_float.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Oct 17, 2023
1 parent 3932755 commit 2b41aad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/basic/test_float.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ function assert(actual, expected, message) {
if (arguments.length == 1)
expected = true;

if (actual == expected)
if (actual === expected)
return;

if (actual !== null && expected !== null
&& typeof actual == 'object' && typeof expected == 'object'
&& actual.toString() === expected.toString())
return;

throw Error("assertion failed: got |" + actual + "|" +
Expand All @@ -14,7 +19,7 @@ function assert(actual, expected, message) {

function test_to_string() {
assert(1.1.toString(), "1.1")
assert(-1.1.toString(), "-1.100000")
assert((-1.1).toString(), "-1.1")
assert(3.14159265354.toString(), "3.1415926540000000")
}

Expand Down

0 comments on commit 2b41aad

Please sign in to comment.