Skip to content
Snippets Groups Projects
Commit 28649e87 authored by André Bargull's avatar André Bargull
Browse files

Correct test assertion (Fixes issue#61)

Changed Number.isNaN_Boolean.js, String.prototype.endsWith_Fail.js and String.prototype.endsWith_Fail_2.js to test for the correct result. Also removed implicit coercion in a couple of other test files.
parent 64756c25
No related branches found
No related tags found
No related merge requests found
Showing
with 12 additions and 12 deletions
...@@ -13,6 +13,6 @@ includes: [runTestCase.js] ...@@ -13,6 +13,6 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
return Number.isNaN(true); return Number.isNaN(true) === false;
} }
runTestCase(testcase); runTestCase(testcase);
...@@ -13,6 +13,6 @@ includes: [runTestCase.js] ...@@ -13,6 +13,6 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
return Number.isNaN(NaN); return Number.isNaN(NaN) === true;
} }
runTestCase(testcase); runTestCase(testcase);
...@@ -15,6 +15,6 @@ includes: [runTestCase.js] ...@@ -15,6 +15,6 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
return !Number.isNaN(new Object()); return Number.isNaN(new Object()) === false;
} }
runTestCase(testcase); runTestCase(testcase);
...@@ -13,6 +13,6 @@ includes: [runTestCase.js] ...@@ -13,6 +13,6 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
return !Number.isNaN('string'); return Number.isNaN('string') === false;
} }
runTestCase(testcase); runTestCase(testcase);
...@@ -15,7 +15,7 @@ includes: [runTestCase.js] ...@@ -15,7 +15,7 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
if('word'.contains('w', 0)) { if('word'.contains('w', 0) === true) {
return true; return true;
} }
} }
......
...@@ -15,7 +15,7 @@ includes: [runTestCase.js] ...@@ -15,7 +15,7 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
if('word'.contains('w')) { if('word'.contains('w') === true) {
return true; return true;
} }
} }
......
...@@ -13,7 +13,7 @@ includes: [runTestCase.js] ...@@ -13,7 +13,7 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
if('word'.endsWith('r')) { if('word'.endsWith('r') === false) {
return true; return true;
} }
} }
......
...@@ -15,7 +15,7 @@ includes: [runTestCase.js] ...@@ -15,7 +15,7 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
if('word'.endsWith('d',3)) { if('word'.endsWith('d', 3) === false) {
return true; return true;
} }
} }
......
...@@ -15,7 +15,7 @@ includes: [runTestCase.js] ...@@ -15,7 +15,7 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
if('word'.endsWith('d')) { if('word'.endsWith('d') === true) {
return true; return true;
} }
} }
......
...@@ -15,7 +15,7 @@ includes: [runTestCase.js] ...@@ -15,7 +15,7 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
if('word'.endsWith('d', 4)) { if('word'.endsWith('d', 4) === true) {
return true; return true;
} }
} }
......
...@@ -15,7 +15,7 @@ includes: [runTestCase.js] ...@@ -15,7 +15,7 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
if('word'.endsWith('d', 25)) { if('word'.endsWith('d', 25) === true) {
return true; return true;
} }
} }
......
...@@ -15,7 +15,7 @@ includes: [runTestCase.js] ...@@ -15,7 +15,7 @@ includes: [runTestCase.js]
---*/ ---*/
function testcase() { function testcase() {
if('word'.endsWith('r',3)) { if('word'.endsWith('r', 3) === true) {
return true; return true;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment