From 28649e877278312dcc36305233011bd41384d437 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Bargull?= <andre.bargull@gmail.com>
Date: Mon, 4 Aug 2014 19:10:41 +0200
Subject: [PATCH] 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.
---
 test/suite/es6/Number.isNaN/Number.isNaN_Boolean.js             | 2 +-
 test/suite/es6/Number.isNaN/Number.isNaN_NaN.js                 | 2 +-
 test/suite/es6/Number.isNaN/Number.isNaN_Object.js              | 2 +-
 test/suite/es6/Number.isNaN/Number.isNaN_String.js              | 2 +-
 .../String.prototype.contains_Success.js                        | 2 +-
 .../String.prototype.contains_SuccessNoLocation.js              | 2 +-
 .../String.prototype.endsWith/String.prototype.endsWith_Fail.js | 2 +-
 .../String.prototype.endsWith_Fail_2.js                         | 2 +-
 .../String.prototype.endsWith_Success.js                        | 2 +-
 .../String.prototype.endsWith_Success_2.js                      | 2 +-
 .../String.prototype.endsWith_Success_3.js                      | 2 +-
 .../String.prototype.endsWith_Success_4.js                      | 2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/test/suite/es6/Number.isNaN/Number.isNaN_Boolean.js b/test/suite/es6/Number.isNaN/Number.isNaN_Boolean.js
index bc984f4d1a..e18c57f9bb 100644
--- a/test/suite/es6/Number.isNaN/Number.isNaN_Boolean.js
+++ b/test/suite/es6/Number.isNaN/Number.isNaN_Boolean.js
@@ -13,6 +13,6 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  return Number.isNaN(true);
+  return Number.isNaN(true) === false;
  }
 runTestCase(testcase);
diff --git a/test/suite/es6/Number.isNaN/Number.isNaN_NaN.js b/test/suite/es6/Number.isNaN/Number.isNaN_NaN.js
index 79ddbfa9ba..6a96ccc27c 100644
--- a/test/suite/es6/Number.isNaN/Number.isNaN_NaN.js
+++ b/test/suite/es6/Number.isNaN/Number.isNaN_NaN.js
@@ -13,6 +13,6 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  return Number.isNaN(NaN);
+  return Number.isNaN(NaN) === true;
  }
 runTestCase(testcase);
diff --git a/test/suite/es6/Number.isNaN/Number.isNaN_Object.js b/test/suite/es6/Number.isNaN/Number.isNaN_Object.js
index b088e4323d..2aff516b5c 100644
--- a/test/suite/es6/Number.isNaN/Number.isNaN_Object.js
+++ b/test/suite/es6/Number.isNaN/Number.isNaN_Object.js
@@ -15,6 +15,6 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  return !Number.isNaN(new Object());
+  return Number.isNaN(new Object()) === false;
  }
 runTestCase(testcase);
diff --git a/test/suite/es6/Number.isNaN/Number.isNaN_String.js b/test/suite/es6/Number.isNaN/Number.isNaN_String.js
index b50ee38db3..f5f8ef5040 100644
--- a/test/suite/es6/Number.isNaN/Number.isNaN_String.js
+++ b/test/suite/es6/Number.isNaN/Number.isNaN_String.js
@@ -13,6 +13,6 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  return !Number.isNaN('string');
+  return Number.isNaN('string') === false;
  }
 runTestCase(testcase);
diff --git a/test/suite/es6/String.prototype.contains/String.prototype.contains_Success.js b/test/suite/es6/String.prototype.contains/String.prototype.contains_Success.js
index c653e6957a..a7d99ad9ad 100644
--- a/test/suite/es6/String.prototype.contains/String.prototype.contains_Success.js
+++ b/test/suite/es6/String.prototype.contains/String.prototype.contains_Success.js
@@ -15,7 +15,7 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  if('word'.contains('w', 0)) {
+  if('word'.contains('w', 0) === true) {
   	return true;
   }
  }
diff --git a/test/suite/es6/String.prototype.contains/String.prototype.contains_SuccessNoLocation.js b/test/suite/es6/String.prototype.contains/String.prototype.contains_SuccessNoLocation.js
index dc98cd2582..cd1c00cae8 100644
--- a/test/suite/es6/String.prototype.contains/String.prototype.contains_SuccessNoLocation.js
+++ b/test/suite/es6/String.prototype.contains/String.prototype.contains_SuccessNoLocation.js
@@ -15,7 +15,7 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  if('word'.contains('w')) {
+  if('word'.contains('w') === true) {
   	return true;
   }
  }
diff --git a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Fail.js b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Fail.js
index 8e34faaa7c..cab5e1c543 100644
--- a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Fail.js
+++ b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Fail.js
@@ -13,7 +13,7 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  if('word'.endsWith('r')) {
+  if('word'.endsWith('r') === false) {
   	return true;
   }
  }
diff --git a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Fail_2.js b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Fail_2.js
index df4a5c5724..00c9854ce9 100644
--- a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Fail_2.js
+++ b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Fail_2.js
@@ -15,7 +15,7 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  if('word'.endsWith('d',3)) {
+  if('word'.endsWith('d', 3) === false) {
   	return true;
   }
  }
diff --git a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success.js b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success.js
index 4128c4d335..ae115452e1 100644
--- a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success.js
+++ b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success.js
@@ -15,7 +15,7 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  if('word'.endsWith('d')) {
+  if('word'.endsWith('d') === true) {
   	return true;
   }
  }
diff --git a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_2.js b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_2.js
index 4314942775..b9b1d98c8c 100644
--- a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_2.js
+++ b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_2.js
@@ -15,7 +15,7 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  if('word'.endsWith('d', 4)) {
+  if('word'.endsWith('d', 4) === true) {
   	return true;
   }
  }
diff --git a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_3.js b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_3.js
index 369b76c154..7e7352d4ab 100644
--- a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_3.js
+++ b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_3.js
@@ -15,7 +15,7 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  if('word'.endsWith('d', 25)) {
+  if('word'.endsWith('d', 25) === true) {
   	return true;
   }
  }
diff --git a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_4.js b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_4.js
index 1954027b9a..0da8b5edb6 100644
--- a/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_4.js
+++ b/test/suite/es6/String.prototype.endsWith/String.prototype.endsWith_Success_4.js
@@ -15,7 +15,7 @@ includes: [runTestCase.js]
 ---*/
 
 function testcase() {
-  if('word'.endsWith('r',3)) {
+  if('word'.endsWith('r', 3) === true) {
   	return true;
   }
  }
-- 
GitLab