From a3bfd5a61f048674f317d312d0b879e5c9fd4c62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Bargull?= <andre.bargull@gmail.com>
Date: Thu, 6 Aug 2015 18:19:54 +0200
Subject: [PATCH] Replace runTestCase with assert helpers
 [test/built-ins/Array]

---
 test/built-ins/Array/15.4.5-1.js              |  9 ++-------
 test/built-ins/Array/15.4.5.1-3.d-3.js        |  7 ++-----
 test/built-ins/Array/15.4.5.1-5-1.js          |  7 ++-----
 test/built-ins/Array/15.4.5.1-5-2.js          |  7 ++-----
 test/built-ins/Array/isArray/15.4.3.2-0-1.js  |  9 ++-------
 test/built-ins/Array/isArray/15.4.3.2-0-2.js  |  8 +-------
 test/built-ins/Array/isArray/15.4.3.2-0-3.js  |  9 ++-------
 test/built-ins/Array/isArray/15.4.3.2-0-4.js  | 19 +++++++------------
 test/built-ins/Array/isArray/15.4.3.2-0-5.js  |  9 ++-------
 test/built-ins/Array/isArray/15.4.3.2-0-6.js  |  9 ++-------
 test/built-ins/Array/isArray/15.4.3.2-0-7.js  |  9 ++-------
 test/built-ins/Array/isArray/15.4.3.2-1-13.js |  7 +------
 test/built-ins/Array/isArray/15.4.3.2-2-1.js  |  8 ++------
 test/built-ins/Array/isArray/15.4.3.2-2-2.js  |  7 +------
 .../Array/prototype/splice/15.4.4.12-9-a-1.js |  8 +++-----
 15 files changed, 33 insertions(+), 99 deletions(-)

diff --git a/test/built-ins/Array/15.4.5-1.js b/test/built-ins/Array/15.4.5-1.js
index 16c499e9c7..d8a00abd4a 100644
--- a/test/built-ins/Array/15.4.5-1.js
+++ b/test/built-ins/Array/15.4.5-1.js
@@ -4,14 +4,9 @@
 /*---
 es5id: 15.4.5-1
 description: Array instances have [[Class]] set to 'Array'
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
   var a = [];
   var s = Object.prototype.toString.call(a);
-  if (s === '[object Array]') {
-    return true;
-  }
- }
-runTestCase(testcase);
+
+assert.sameValue(s, '[object Array]', 's');
diff --git a/test/built-ins/Array/15.4.5.1-3.d-3.js b/test/built-ins/Array/15.4.5.1-3.d-3.js
index 61e4d9b61b..7367a8a0fc 100644
--- a/test/built-ins/Array/15.4.5.1-3.d-3.js
+++ b/test/built-ins/Array/15.4.5.1-3.d-3.js
@@ -4,12 +4,9 @@
 /*---
 es5id: 15.4.5.1-3.d-3
 description: Set array length property to max value 4294967295 (2**32-1,)
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {  
   var a =[];
   a.length = 4294967295 ;
-  return a.length===4294967295 ;
- }
-runTestCase(testcase);
+
+assert.sameValue(a.length, 4294967295, 'a.length');
diff --git a/test/built-ins/Array/15.4.5.1-5-1.js b/test/built-ins/Array/15.4.5.1-5-1.js
index 00bcc54f2d..945bf9ae4e 100644
--- a/test/built-ins/Array/15.4.5.1-5-1.js
+++ b/test/built-ins/Array/15.4.5.1-5-1.js
@@ -6,12 +6,9 @@ es5id: 15.4.5.1-5-1
 description: >
     Defining a property named 4294967295 (2**32-1)(not an array
     element)
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {  
   var a =[];
   a[4294967295] = "not an array element" ;
-  return a[4294967295] === "not an array element";
- }
-runTestCase(testcase);
+
+assert.sameValue(a[4294967295], "not an array element", 'a[4294967295]');
diff --git a/test/built-ins/Array/15.4.5.1-5-2.js b/test/built-ins/Array/15.4.5.1-5-2.js
index b7d365dd2f..924c48f479 100644
--- a/test/built-ins/Array/15.4.5.1-5-2.js
+++ b/test/built-ins/Array/15.4.5.1-5-2.js
@@ -6,12 +6,9 @@ es5id: 15.4.5.1-5-2
 description: >
     Defining a property named 4294967295 (2**32-1) doesn't change
     length of the array
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {  
   var a =[0,1,2];
   a[4294967295] = "not an array element" ;
-  return a.length===3;
- }
-runTestCase(testcase);
+
+assert.sameValue(a.length, 3, 'a.length');
diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-1.js b/test/built-ins/Array/isArray/15.4.3.2-0-1.js
index 8ac307382f..a7153724ac 100644
--- a/test/built-ins/Array/isArray/15.4.3.2-0-1.js
+++ b/test/built-ins/Array/isArray/15.4.3.2-0-1.js
@@ -4,13 +4,8 @@
 /*---
 es5id: 15.4.3.2-0-1
 description: Array.isArray must exist as a function
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
   var f = Array.isArray;
-  if (typeof(f) === "function") {
-    return true;
-  }
- }
-runTestCase(testcase);
+
+assert.sameValue(typeof(f), "function", 'typeof(f)');
diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-2.js b/test/built-ins/Array/isArray/15.4.3.2-0-2.js
index 07bb3368de..ba95a7ad4a 100644
--- a/test/built-ins/Array/isArray/15.4.3.2-0-2.js
+++ b/test/built-ins/Array/isArray/15.4.3.2-0-2.js
@@ -4,12 +4,6 @@
 /*---
 es5id: 15.4.3.2-0-2
 description: Array.isArray must exist as a function taking 1 parameter
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
-  if (Array.isArray.length === 1) {
-    return true;
-  }
- }
-runTestCase(testcase);
+assert.sameValue(Array.isArray.length, 1, 'Array.isArray.length');
diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-3.js b/test/built-ins/Array/isArray/15.4.3.2-0-3.js
index 62dd2a7007..4b8141dc7f 100644
--- a/test/built-ins/Array/isArray/15.4.3.2-0-3.js
+++ b/test/built-ins/Array/isArray/15.4.3.2-0-3.js
@@ -4,14 +4,9 @@
 /*---
 es5id: 15.4.3.2-0-3
 description: Array.isArray return true if its argument is an Array
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
   var a = [];
   var b = Array.isArray(a);
-  if (b === true) {
-    return true;
-  }
- }
-runTestCase(testcase);
+
+assert.sameValue(b, true, 'b');
diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-4.js b/test/built-ins/Array/isArray/15.4.3.2-0-4.js
index 4d70abfa10..652430d8ad 100644
--- a/test/built-ins/Array/isArray/15.4.3.2-0-4.js
+++ b/test/built-ins/Array/isArray/15.4.3.2-0-4.js
@@ -4,10 +4,8 @@
 /*---
 es5id: 15.4.3.2-0-4
 description: Array.isArray return false if its argument is not an Array
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
   var b_num   = Array.isArray(42);
   var b_undef = Array.isArray(undefined);
   var b_bool  = Array.isArray(true);
@@ -15,13 +13,10 @@ function testcase() {
   var b_obj   = Array.isArray({});
   var b_null  = Array.isArray(null);
   
-  if (b_num === false &&
-      b_undef === false &&
-      b_bool === false &&
-      b_str === false &&
-      b_obj === false &&
-      b_null === false) {
-    return true;
-  }
- }
-runTestCase(testcase);
+
+assert.sameValue(b_num, false, 'b_num');
+assert.sameValue(b_undef, false, 'b_undef');
+assert.sameValue(b_bool, false, 'b_bool');
+assert.sameValue(b_str, false, 'b_str');
+assert.sameValue(b_obj, false, 'b_obj');
+assert.sameValue(b_null, false, 'b_null');
diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-5.js b/test/built-ins/Array/isArray/15.4.3.2-0-5.js
index 91c356f96b..70cd14fc48 100644
--- a/test/built-ins/Array/isArray/15.4.3.2-0-5.js
+++ b/test/built-ins/Array/isArray/15.4.3.2-0-5.js
@@ -6,13 +6,8 @@ es5id: 15.4.3.2-0-5
 description: >
     Array.isArray return true if its argument is an Array
     (Array.prototype)
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
   var b = Array.isArray(Array.prototype);
-  if (b === true) {
-    return true;
-  }
- }
-runTestCase(testcase);
+
+assert.sameValue(b, true, 'b');
diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-6.js b/test/built-ins/Array/isArray/15.4.3.2-0-6.js
index d10e943e8b..0a3144adc2 100644
--- a/test/built-ins/Array/isArray/15.4.3.2-0-6.js
+++ b/test/built-ins/Array/isArray/15.4.3.2-0-6.js
@@ -4,14 +4,9 @@
 /*---
 es5id: 15.4.3.2-0-6
 description: Array.isArray return true if its argument is an Array (new Array())
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
   var a = new Array(10);
   var b = Array.isArray(a);
-  if (b === true) {
-    return true;
-  }
- }
-runTestCase(testcase);
+
+assert.sameValue(b, true, 'b');
diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-7.js b/test/built-ins/Array/isArray/15.4.3.2-0-7.js
index 1a593e8993..9292b2de71 100644
--- a/test/built-ins/Array/isArray/15.4.3.2-0-7.js
+++ b/test/built-ins/Array/isArray/15.4.3.2-0-7.js
@@ -4,15 +4,10 @@
 /*---
 es5id: 15.4.3.2-0-7
 description: Array.isArray returns false if its argument is not an Array
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
   var o = new Object();
   o[12] = 13;
   var b = Array.isArray(o);
-  if (b === false) {
-    return true;
-  }
- }
-runTestCase(testcase);
+
+assert.sameValue(b, false, 'b');
diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-13.js b/test/built-ins/Array/isArray/15.4.3.2-1-13.js
index bb8a0cbea2..8d233f114c 100644
--- a/test/built-ins/Array/isArray/15.4.3.2-1-13.js
+++ b/test/built-ins/Array/isArray/15.4.3.2-1-13.js
@@ -4,17 +4,12 @@
 /*---
 es5id: 15.4.3.2-1-13
 description: Array.isArray applied to Arguments object
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
-
         var arg;
 
         (function fun() {
             arg = arguments;
         }(1, 2, 3));
 
-        return !Array.isArray(arg);
-    }
-runTestCase(testcase);
+assert.sameValue(Array.isArray(arg), false, 'Array.isArray(arg)');
diff --git a/test/built-ins/Array/isArray/15.4.3.2-2-1.js b/test/built-ins/Array/isArray/15.4.3.2-2-1.js
index 6e6ff90f4a..55ea40277a 100644
--- a/test/built-ins/Array/isArray/15.4.3.2-2-1.js
+++ b/test/built-ins/Array/isArray/15.4.3.2-2-1.js
@@ -4,16 +4,12 @@
 /*---
 es5id: 15.4.3.2-2-1
 description: Array.isArray applied to an object with an array as the prototype
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
-
         var proto = [];
         var Con = function () { };
         Con.prototype = proto;
 
         var child = new Con();
-        return !Array.isArray(child);
-    }
-runTestCase(testcase);
+
+assert.sameValue(Array.isArray(child), false, 'Array.isArray(child)');
diff --git a/test/built-ins/Array/isArray/15.4.3.2-2-2.js b/test/built-ins/Array/isArray/15.4.3.2-2-2.js
index 2453dda4e7..1c37dee8fb 100644
--- a/test/built-ins/Array/isArray/15.4.3.2-2-2.js
+++ b/test/built-ins/Array/isArray/15.4.3.2-2-2.js
@@ -6,17 +6,12 @@ es5id: 15.4.3.2-2-2
 description: >
     Array.isArray applied to an object with Array.prototype as the
     prototype
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
-
         var proto = Array.prototype;
         var Con = function () { };
         Con.prototype = proto;
 
         var child = new Con();
 
-        return !Array.isArray(child);
-    }
-runTestCase(testcase);
+assert.sameValue(Array.isArray(child), false, 'Array.isArray(child)');
diff --git a/test/built-ins/Array/prototype/splice/15.4.4.12-9-a-1.js b/test/built-ins/Array/prototype/splice/15.4.4.12-9-a-1.js
index 02c3116693..ce423f3e34 100644
--- a/test/built-ins/Array/prototype/splice/15.4.4.12-9-a-1.js
+++ b/test/built-ins/Array/prototype/splice/15.4.4.12-9-a-1.js
@@ -6,12 +6,10 @@ es5id: 15.4.4.12-9-a-1
 description: >
     Array.prototype.splice - 'from' is the result of
     ToString(actualStart+k) in an Array
-includes: [runTestCase.js]
 ---*/
 
-function testcase() {
         var arrObj = [1, 2, 3];
         var newArrObj = arrObj.splice(-2, 1);
-        return newArrObj.length === 1 && newArrObj[0] === 2;
-    }
-runTestCase(testcase);
+
+assert.sameValue(newArrObj.length, 1, 'newArrObj.length');
+assert.sameValue(newArrObj[0], 2, 'newArrObj[0]');
-- 
GitLab