You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found out that this line is causing problem: some runTest tests that are suppose to fail are not failing because you are comparing 0 with 0 because isNaN('a string') or isNaN([1, 2]) returns true: all the tests that tries to compare strings or arrays are not valid.
repro step:
Try to modify any runTest test in test/string_operators.js or test/array_operators.js to make it fail (hint: it won't!).
I think the proper way to fix it is to do the following:
- if (isNaN(actual) && isNaN(expected)) actual = expected = 0+ if (actual !== actual && expected !== expected) actual = expected = 0
because NaN === NaN returns false.
There are 3 tests that fails with the suggested changes, 2 related to unicode characters and string operators, that I am not sure how to solve.
The text was updated successfully, but these errors were encountered:
* filter out empty values from collection. fix#65
* correct NaN comparison in unit tests. fixes#66
* fix tests for $substrCP
* fix $substrBytes
* fix comparison operators by type checkin
* filter out empty values from collection. fix#65
* correct NaN comparison in unit tests. fixes#66
* fix tests for $substrCP
* fix $substrBytes
* fix comparison operators by type checkin
I found out that this line is causing problem: some
runTest
tests that are suppose to fail are not failing because you are comparing0
with0
becauseisNaN('a string')
orisNaN([1, 2])
returns true: all the tests that tries to compare strings or arrays are not valid.repro step:
Try to modify any
runTest
test intest/string_operators.js
ortest/array_operators.js
to make it fail (hint: it won't!).I think the proper way to fix it is to do the following:
because
NaN === NaN
returnsfalse
.There are 3 tests that fails with the suggested changes, 2 related to unicode characters and string operators, that I am not sure how to solve.
The text was updated successfully, but these errors were encountered: