From e5fa1d5ef489e92144686873c2b313026f88bfe8 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 23 Sep 2020 09:57:53 -0400 Subject: [PATCH] Transform: legacy $ERROR -> assert.* --- .../String/prototype/split/S15.5.4.14_A10.js | 23 +++---- .../String/prototype/split/S15.5.4.14_A11.js | 19 ++---- .../prototype/split/S15.5.4.14_A1_T1.js | 28 ++------ .../prototype/split/S15.5.4.14_A1_T10.js | 37 +++-------- .../prototype/split/S15.5.4.14_A1_T11.js | 6 +- .../prototype/split/S15.5.4.14_A1_T12.js | 6 +- .../prototype/split/S15.5.4.14_A1_T13.js | 46 +++---------- .../prototype/split/S15.5.4.14_A1_T14.js | 6 +- .../prototype/split/S15.5.4.14_A1_T15.js | 6 +- .../prototype/split/S15.5.4.14_A1_T16.js | 8 +-- .../prototype/split/S15.5.4.14_A1_T17.js | 66 ++++--------------- .../prototype/split/S15.5.4.14_A1_T18.js | 39 +++-------- .../prototype/split/S15.5.4.14_A1_T2.js | 28 ++------ .../prototype/split/S15.5.4.14_A1_T3.js | 37 +++-------- .../prototype/split/S15.5.4.14_A1_T4.js | 37 +++-------- .../prototype/split/S15.5.4.14_A1_T5.js | 46 +++---------- .../prototype/split/S15.5.4.14_A1_T7.js | 37 +++-------- .../prototype/split/S15.5.4.14_A1_T8.js | 37 +++-------- .../prototype/split/S15.5.4.14_A1_T9.js | 37 +++-------- .../prototype/split/S15.5.4.14_A2_T1.js | 65 ++++-------------- .../prototype/split/S15.5.4.14_A2_T10.js | 27 ++++---- .../prototype/split/S15.5.4.14_A2_T11.js | 29 ++------ .../prototype/split/S15.5.4.14_A2_T12.js | 29 ++------ .../prototype/split/S15.5.4.14_A2_T13.js | 38 +++-------- .../prototype/split/S15.5.4.14_A2_T14.js | 38 +++-------- .../prototype/split/S15.5.4.14_A2_T15.js | 29 ++------ .../prototype/split/S15.5.4.14_A2_T16.js | 29 ++------ .../prototype/split/S15.5.4.14_A2_T17.js | 29 ++------ .../prototype/split/S15.5.4.14_A2_T18.js | 38 +++-------- .../prototype/split/S15.5.4.14_A2_T19.js | 29 ++------ .../prototype/split/S15.5.4.14_A2_T2.js | 65 ++++-------------- .../prototype/split/S15.5.4.14_A2_T20.js | 27 ++++---- .../prototype/split/S15.5.4.14_A2_T21.js | 38 +++-------- .../prototype/split/S15.5.4.14_A2_T22.js | 47 +++---------- .../prototype/split/S15.5.4.14_A2_T23.js | 29 ++------ .../prototype/split/S15.5.4.14_A2_T24.js | 38 +++-------- .../prototype/split/S15.5.4.14_A2_T25.js | 38 +++-------- .../prototype/split/S15.5.4.14_A2_T26.js | 38 +++-------- .../prototype/split/S15.5.4.14_A2_T27.js | 29 ++------ .../prototype/split/S15.5.4.14_A2_T28.js | 29 ++------ .../prototype/split/S15.5.4.14_A2_T29.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T3.js | 38 +++-------- .../prototype/split/S15.5.4.14_A2_T30.js | 32 ++++----- .../prototype/split/S15.5.4.14_A2_T31.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T32.js | 32 ++++----- .../prototype/split/S15.5.4.14_A2_T33.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T34.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T35.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T36.js | 32 ++++----- .../prototype/split/S15.5.4.14_A2_T37.js | 32 ++++----- .../prototype/split/S15.5.4.14_A2_T38.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T39.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T4.js | 59 ++++------------- .../prototype/split/S15.5.4.14_A2_T40.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T41.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T42.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T43.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T5.js | 47 +++---------- .../prototype/split/S15.5.4.14_A2_T6.js | 31 ++++----- .../prototype/split/S15.5.4.14_A2_T7.js | 27 ++++---- .../prototype/split/S15.5.4.14_A2_T8.js | 27 ++++---- .../prototype/split/S15.5.4.14_A2_T9.js | 27 ++++---- .../prototype/split/S15.5.4.14_A3_T1.js | 29 ++------ .../prototype/split/S15.5.4.14_A3_T10.js | 29 ++------ .../prototype/split/S15.5.4.14_A3_T11.js | 29 ++------ .../prototype/split/S15.5.4.14_A3_T2.js | 29 ++------ .../prototype/split/S15.5.4.14_A3_T3.js | 29 ++------ .../prototype/split/S15.5.4.14_A3_T4.js | 29 ++------ .../prototype/split/S15.5.4.14_A3_T5.js | 29 ++------ .../prototype/split/S15.5.4.14_A3_T6.js | 32 ++++----- .../prototype/split/S15.5.4.14_A3_T7.js | 29 ++------ .../prototype/split/S15.5.4.14_A3_T8.js | 29 ++------ .../prototype/split/S15.5.4.14_A3_T9.js | 29 ++------ .../prototype/split/S15.5.4.14_A4_T1.js | 47 +++---------- .../prototype/split/S15.5.4.14_A4_T10.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T11.js | 32 ++++----- .../prototype/split/S15.5.4.14_A4_T12.js | 32 ++++----- .../prototype/split/S15.5.4.14_A4_T13.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T14.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T15.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T16.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T17.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T18.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T19.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T2.js | 20 ++---- .../prototype/split/S15.5.4.14_A4_T20.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T21.js | 32 ++++----- .../prototype/split/S15.5.4.14_A4_T22.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T23.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T24.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T25.js | 31 ++++----- .../prototype/split/S15.5.4.14_A4_T3.js | 29 ++------ .../prototype/split/S15.5.4.14_A4_T4.js | 38 +++-------- .../prototype/split/S15.5.4.14_A4_T5.js | 47 +++---------- .../prototype/split/S15.5.4.14_A4_T6.js | 47 +++---------- .../prototype/split/S15.5.4.14_A4_T7.js | 47 +++---------- .../prototype/split/S15.5.4.14_A4_T8.js | 20 ++---- .../prototype/split/S15.5.4.14_A4_T9.js | 47 +++---------- .../String/prototype/split/S15.5.4.14_A6.js | 12 ++-- .../String/prototype/split/S15.5.4.14_A7.js | 6 +- .../String/prototype/split/S15.5.4.14_A8.js | 30 ++++----- .../String/prototype/split/S15.5.4.14_A9.js | 30 +++------ 102 files changed, 1012 insertions(+), 2261 deletions(-) diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A10.js b/test/built-ins/String/prototype/split/S15.5.4.14_A10.js index 153a57b566..84a0d02b60 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A10.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A10.js @@ -10,13 +10,10 @@ description: > includes: [propertyHelper.js] ---*/ -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (!(String.prototype.split.hasOwnProperty('length'))) { - $ERROR('#1: String.prototype.split.hasOwnProperty(\'length\') return true. Actual: ' + String.prototype.split.hasOwnProperty('length')); -} -// -////////////////////////////////////////////////////////////////////////////// +assert( + String.prototype.split.hasOwnProperty('length'), + 'String.prototype.split.hasOwnProperty(\'length\') must return true' +); var __obj = String.prototype.split.length; @@ -24,10 +21,8 @@ verifyNotWritable(String.prototype.split, "length", null, function() { return "shifted"; }); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (String.prototype.split.length !== __obj) { - $ERROR('#2: __obj = String.prototype.split.length; String.prototype.split.length = function(){return "shifted";}; String.prototype.split.length === __obj. Actual: ' + String.prototype.split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + String.prototype.split.length, + __obj, + 'The value of String.prototype.split.length is expected to equal the value of __obj' +); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A11.js b/test/built-ins/String/prototype/split/S15.5.4.14_A11.js index e5ca3139e5..dad66583eb 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A11.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A11.js @@ -7,18 +7,9 @@ es5id: 15.5.4.14_A11 description: Checking String.prototype.split.length ---*/ -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (!(String.prototype.split.hasOwnProperty("length"))) { - $ERROR('#1: String.prototype.split.hasOwnProperty("length") return true. Actual: ' + String.prototype.split.hasOwnProperty("length")); -} -// -////////////////////////////////////////////////////////////////////////////// +assert( + String.prototype.split.hasOwnProperty("length"), + 'String.prototype.split.hasOwnProperty("length") must return true' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (String.prototype.split.length !== 2) { - $ERROR('#2: String.prototype.split.length === 2. Actual: ' + String.prototype.split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(String.prototype.split.length, 2, 'The value of String.prototype.split.length is 2'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T1.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T1.js index 69ca403434..aeaea00f58 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T1.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T1.js @@ -18,26 +18,12 @@ __instance.split = String.prototype.split; var __split = __instance.split(true, false); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: __instance = new Object(true); __instance.split = String.prototype.split; __split = __instance.split(true, false); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: __instance = new Object(true); __instance.split = String.prototype.split; __split = __instance.split(true, false); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 0) { - $ERROR('#3: __instance = new Object(true); __instance.split = String.prototype.split; __split = __instance.split(true, false); __split.length === 0. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 0, 'The value of __split.length is 0'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T10.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T10.js index c56b54de71..fb06acf3d6 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T10.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T10.js @@ -29,34 +29,13 @@ var __str = "ABB\u0041BABAB"; var __split = __str.split(__obj, __obj2); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: var __obj = {toString:function(){return "u0042B";}}; var __obj2 = {valueOf:function(){return true;}}; var __str = "ABBu0041BABAB"; var __split = split(__obj, __obj2); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: var __obj = {toString:function(){return "u0042B";}}; var __obj2 = {valueOf:function(){return true;}}; var __str = "ABBu0041BABAB"; var __split = split(__obj, __obj2); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 1) { - $ERROR('#3: var __obj = {toString:function(){return "u0042B";}}; var __obj2 = {valueOf:function(){return true;}}; var __str = "ABBu0041BABAB"; var __split = split(__obj, __obj2); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[0] !== "A") { - $ERROR('#4: var __obj = {toString:function(){return "u0042B";}}; var __obj2 = {valueOf:function(){return true;}}; var __str = "ABBu0041BABAB"; var __split = split(__obj, __obj2); __split[0] === "A". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "A", 'The value of __split[0] is "A"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T11.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T11.js index 73d4917a71..0ddf0306ea 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T11.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T11.js @@ -31,11 +31,9 @@ var __str = "ABB\u0041BABAB"; //CHECK#1 try { var x = __str.split(__obj, __obj2); - $ERROR('#1: "var x = __str.split(__obj, __obj2)" lead to throwing exception'); + Test262Error.thrower('#1: "var x = __str.split(__obj, __obj2)" lead to throwing exception'); } catch (e) { - if (e !== "intointeger") { - $ERROR('#1.1: Exception === "intointeger". Actual: ' + e); - } + assert.sameValue(e, "intointeger", 'The value of `e` is "intointeger"'); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T12.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T12.js index 5fe3720499..be44adf3f4 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T12.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T12.js @@ -34,11 +34,9 @@ var __str = new String("ABB\u0041BABAB"); //CHECK#1 try { var x = __str.split(__obj, __obj2); - $ERROR('#1: "var x = __str.split(__obj, __obj2)" lead to throwing exception'); + Test262Error.thrower('#1: "var x = __str.split(__obj, __obj2)" lead to throwing exception'); } catch (e) { - if (e !== "intointeger") { - $ERROR('#1.1: Exception === "intointeger". Actual: ' + e); - } + assert.sameValue(e, "intointeger", 'The value of `e` is "intointeger"'); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T13.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T13.js index eded7e4c0f..c1abab9c87 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T13.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T13.js @@ -31,42 +31,14 @@ var __obj2 = { var __split = "ABB\u0041BABAB\u0042cc^^\u0042Bvv%%B\u0042xxx".split(__obj, __obj2); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: var __obj = {toString:function(){return "u0042u0042";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}}; __split = "ABBu0041BABABu0042cc^^u0042Bvv%%Bu0042xxx".split(__obj, __obj2); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: var __obj = {toString:function(){return "u0042u0042";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}}; __split = "ABBu0041BABABu0042cc^^u0042Bvv%%Bu0042xxx".split(__obj, __obj2); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 2) { - $ERROR('#3: var __obj = {toString:function(){return "u0042u0042";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}}; __split = "ABBu0041BABABu0042cc^^u0042Bvv%%Bu0042xxx".split(__obj, __obj2); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[0] !== "A") { - $ERROR('#4: var __obj = {toString:function(){return "u0042u0042";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}}; __split = "ABBu0041BABABu0042cc^^u0042Bvv%%Bu0042xxx".split(__obj, __obj2); __split[0] === "A". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[1] !== "ABABA") { - $ERROR('#5: var __obj = {toString:function(){return "u0042u0042";}}; var __obj2 = {valueOf:function(){return {};},toString:function(){return "2";}}; __split = "ABBu0041BABABu0042cc^^u0042Bvv%%Bu0042xxx".split(__obj, __obj2); __split[1] === "ABABA". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "A", 'The value of __split[0] is "A"'); +assert.sameValue(__split[1], "ABABA", 'The value of __split[1] is "ABABA"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T14.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T14.js index df6ee1d693..8ecb86a114 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T14.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T14.js @@ -32,11 +32,9 @@ Number.prototype.split = String.prototype.split; //CHECK#1 try { var x = __instance.split(__obj, __obj2); - $ERROR('#1: "var x = __instance.split(__obj, __obj2)" lead to throwing exception'); + Test262Error.thrower('#1: "var x = __instance.split(__obj, __obj2)" lead to throwing exception'); } catch (e) { - if (e !== "intoint") { - $ERROR('#1.1: Exception === "intoint". Actual: ' + e); - } + assert.sameValue(e, "intoint", 'The value of `e` is "intoint"'); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T15.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T15.js index 52c2fc9ca7..26c5dc0e74 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T15.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T15.js @@ -39,11 +39,9 @@ var __instance = new __FACTORY(void 0); //CHECK#1 try { var x = __instance.split(__obj, __obj2); - $ERROR('#1: "var x = __instance.split(__obj, __obj2)" lead to throwing exception'); + Test262Error.thrower('#1: "var x = __instance.split(__obj, __obj2)" lead to throwing exception'); } catch (e) { - if (e !== "intointeger") { - $ERROR('#1.1: Exception === "intointeger". Actual: ' + e); - } + assert.sameValue(e, "intointeger", 'The value of `e` is "intointeger"'); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T16.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T16.js index 4fb875732e..c085bb1d1c 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T16.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T16.js @@ -23,10 +23,8 @@ var __obj = { Number.prototype.split = String.prototype.split; try { - var __split = 6776767677.006771122677555.split(__obj); - $ERROR('#1: "__split = 6776767677.006771122677555.split(__obj)" lead to throwing exception'); + var __split = (6776767677.006771122677555).split(__obj); + Test262Error.thrower('#1: "__split = 6776767677.006771122677555.split(__obj)" lead to throwing exception'); } catch (e) { - if (!(e instanceof TypeError)) { - $ERROR('#1.1: Exception is instance of TypeError. Actual: ' + e); - } + assert(e instanceof TypeError, 'The result of `(e instanceof TypeError)` is true'); } diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T17.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T17.js index 95124d9cd9..cd6c58ec84 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T17.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T17.js @@ -16,60 +16,18 @@ var __re = /\u0037\u0037/g; Number.prototype.split = String.prototype.split; -var __split = 6776767677.006771122677555.split(__re); +var __split = (6776767677.006771122677555).split(__re); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 4) { - $ERROR('#3: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split.length === 4. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[0] !== "6") { - $ERROR('#4: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split[0] === "6". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[1] !== "67676") { - $ERROR('#5: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split[1] === "67676". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#6 -if (__split[2] !== ".006") { - $ERROR('#6: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split[2] === ".006". Actual: ' + __split[2]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#7 -if (__split[3] !== "1") { - $ERROR('#7: var __re = /u0037u0037/g; Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re); __split[3] === "1". Actual: ' + __split[3]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 4, 'The value of __split.length is 4'); +assert.sameValue(__split[0], "6", 'The value of __split[0] is "6"'); +assert.sameValue(__split[1], "67676", 'The value of __split[1] is "67676"'); +assert.sameValue(__split[2], ".006", 'The value of __split[2] is ".006"'); +assert.sameValue(__split[3], "1", 'The value of __split[3] is "1"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T18.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T18.js index 4c8fdbfb68..fe649341a0 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T18.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T18.js @@ -16,36 +16,15 @@ var __re = new RegExp("00"); Number.prototype.split = String.prototype.split; -var __split = 6776767677.006771122677555.split(__re, eval("\"1\"")); +var __split = (6776767677.006771122677555).split(__re, eval("\"1\"")); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: var __re = new RegExp("00"); Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re, eval(""1"")); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: var __re = new RegExp("00"); Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re, eval(""1"")); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 1) { - $ERROR('#3: var __re = new RegExp("00"); Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re, eval(""1"")); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "6776767677.") { - $ERROR('#3: var __re = new RegExp("00"); Number.prototype.split=String.prototype.split; __split = 6776767677.006771122677555.split(__re, eval(""1"")); __split[0] === "6776767677.". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "6776767677.", 'The value of __split[0] is "6776767677."'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T2.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T2.js index 775ac3f566..a8a106b7b5 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T2.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T2.js @@ -22,26 +22,12 @@ var __split = __instance.split("A" !== "\u0041", function() { return 0; }(), null); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split("A"!=="u0041", function(){return 0;}(),null); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split("A"!=="u0041", function(){return 0;}(),null); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 0) { - $ERROR('#3: __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split("A"!=="u0041", function(){return 0;}(),null); __split.length === 0. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 0, 'The value of __split.length is 0'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T3.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T3.js index cb21c14a12..a254ddb97c 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T3.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T3.js @@ -32,35 +32,14 @@ if (toString === Object.prototype.toString) { var __split = split(eval("\"[\""), __obj__lim); - ////////////////////////////////////////////////////////////////////////////// - //CHECK#1 - if (typeof __split !== "object") { - $ERROR('#1: typeof __split === "object". Actual: ' + typeof __split); - } - // - ////////////////////////////////////////////////////////////////////////////// + assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); - ////////////////////////////////////////////////////////////////////////////// - //CHECK#2 - if (__split.constructor !== Array) { - $ERROR('#2: __split.constructor === Array. Actual: ' + __split.constructor); - } - // - ////////////////////////////////////////////////////////////////////////////// + assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' + ); - ////////////////////////////////////////////////////////////////////////////// - //CHECK#3 - if (__split.length !== 2) { - $ERROR('#3: __split.length === 2. Actual: ' + __split.length); - } - // - ////////////////////////////////////////////////////////////////////////////// - - ////////////////////////////////////////////////////////////////////////////// - //CHECK#3 - if (__split[1].substring(0, 6) !== "object") { - $ERROR('#4: __split[1].substring(0,6) === "object". Actual: ' + __split[1].substring(0, 6)); - } - // - ////////////////////////////////////////////////////////////////////////////// + assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); + assert.sameValue(__split[1].substring(0, 6), "object", '__split[1].substring(0, 6) must return "object"'); } diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T4.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T4.js index f2931438d2..af47696ed6 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T4.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T4.js @@ -15,34 +15,13 @@ description: Call split without arguments, and instance is empty string //since ToString() evaluates to "" split() evaluates to split("",0) var __split = "".split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: __split = "".split(); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: __split = "".split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 1) { - $ERROR('#3: __split = "".split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[0] !== "") { - $ERROR('#4: __split = "".split(); __split[0] === "". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "", 'The value of __split[0] is ""'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T5.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T5.js index 982309d1ac..636ecdbf6b 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T5.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T5.js @@ -19,42 +19,14 @@ var __split = function() { return "gnulluna" }().split(null); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: __split = function(){return "gnulluna"}().split(null); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: __split = function(){return "gnulluna"}().split(null); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 2) { - $ERROR('#3: __split = function(){return "gnulluna"}().split(null); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[0] !== "g") { - $ERROR('#4: __split = function(){return "gnulluna"}().split(null); __split[0] === "g". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[1] !== "una") { - $ERROR('#5: __split = function(){return "gnulluna"}().split(null); __split[1] === "una". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "g", 'The value of __split[0] is "g"'); +assert.sameValue(__split[1], "una", 'The value of __split[1] is "una"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T7.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T7.js index 02cfc01651..5341e5b299 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T7.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T7.js @@ -14,34 +14,13 @@ description: Argument is undefined, and instance is String var __split = String("undefinedd").split(undefined); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: __split = String("undefinedd").split(undefined); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: __split = String("undefinedd").split(undefined); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 1) { - $ERROR('#3: __split = String("undefinedd").split(undefined); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[0] !== "undefinedd") { - $ERROR('#4: __split = String("undefinedd").split(undefined); __split[0] === "undefinedd". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "undefinedd", 'The value of __split[0] is "undefinedd"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T8.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T8.js index 05eb86148f..5d0cbd78c7 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T8.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T8.js @@ -20,34 +20,13 @@ var __obj = { var __split = String(__obj).split(void 0); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 1) { - $ERROR('#3: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[0] !== "undefined") { - $ERROR('#4: __obj = {toString:function(){}}; __split = String(__obj).split(void 0); __split[0] !== "undefined". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "undefined", 'The value of __split[0] is "undefined"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T9.js b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T9.js index eb545020d0..acb9ebe513 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A1_T9.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A1_T9.js @@ -22,34 +22,13 @@ var __obj = { //since ToString(undefined) evaluates to "undefined" var __split = new String(__obj).split(function() {}()); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (typeof __split !== "object") { - $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); typeof __split === "object". Actual: ' + typeof __split); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(typeof __split, "object", 'The value of `typeof __split` is "object"'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.constructor !== Array) { - $ERROR('#2: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split.length !== 1) { - $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[0] !== "undefined") { - $ERROR('#4: __obj = {valueOf:function(){}, toString:void 0}; __split = new String(__obj).split(function(){}()); __split[0] !== "undefined". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "undefined", 'The value of __split[0] is "undefined"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T1.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T1.js index fdf968d873..f2bb289647 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T1.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T1.js @@ -15,58 +15,15 @@ var __string = new String("one,two,three,four,five"); var __split = __string.split(","); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 5) { - $ERROR('#2: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split.length === 5. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "one") { - $ERROR('#3: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split[0] === "one". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "two") { - $ERROR('#4: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split[1] === "two". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[2] !== "three") { - $ERROR('#5: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split[2] === "three". Actual: ' + __split[2]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#6 -if (__split[3] !== "four") { - $ERROR('#6: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split[3] === "four". Actual: ' + __split[3]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#7 -if (__split[4] !== "five") { - $ERROR('#7: var __string = new String("one,two,three,four,five"); __split = __string.split(","); __split[4] === "five". Actual: ' + __split[4]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 5, 'The value of __split.length is 5'); +assert.sameValue(__split[0], "one", 'The value of __split[0] is "one"'); +assert.sameValue(__split[1], "two", 'The value of __split[1] is "two"'); +assert.sameValue(__split[2], "three", 'The value of __split[2] is "three"'); +assert.sameValue(__split[3], "four", 'The value of __split[3] is "four"'); +assert.sameValue(__split[4], "five", 'The value of __split[4] is "five"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T10.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T10.js index eff95ed197..2f9133a446 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T10.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T10.js @@ -16,28 +16,25 @@ var __expected = ["this", "is", "a", "string", "object"]; var __split = __string.split(123); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = "this123is123a123string123object"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(123); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: var __string = "this123is123a123string123object"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(123); __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var i = 0; i < __expected.length; i++) { - if (__expected[i] !== __split[i]) { - $ERROR('#3.' + i + ': var __string = "this123is123a123string123object"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(123); __expected[' + i + ']===__split[' + i + ']. Actual: ' + __expected[i]); - } + assert.sameValue(__expected[i], __split[i], 'The value of __expected[i] is expected to equal the value of __split[i]'); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T11.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T11.js index b29dc9e0e0..ae7da1169d 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T11.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T11.js @@ -15,26 +15,11 @@ var __string = new String("one-1,two-2,four-4"); var __split = __string.split(":"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one-1,two-2,four-4"); __split = __string.split(":"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String("one-1,two-2,four-4"); __split = __string.split(":"); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "one-1,two-2,four-4") { - $ERROR('#3: var __string = new String("one-1,two-2,four-4"); __split = __string.split(":"); __split[0] === "one-1,two-2,four-4". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "one-1,two-2,four-4", 'The value of __split[0] is "one-1,two-2,four-4"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T12.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T12.js index 7696dfa9ed..aec39e3cad 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T12.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T12.js @@ -15,26 +15,11 @@ var __string = new String("one-1 two-2 four-4"); var __split = __string.split("r-42"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one-1 two-2 four-4"); __split = __string.split("r-42"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String("one-1 two-2 four-4"); __split = __string.split("r-42"); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "one-1 two-2 four-4") { - $ERROR('#3: var __string = new String("one-1 two-2 four-4"); __split = __string.split("r-42"); __split[0] === "one-1 two-2 four-4". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "one-1 two-2 four-4", 'The value of __split[0] is "one-1 two-2 four-4"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T13.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T13.js index 067bf5aebe..1faeb36695 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T13.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T13.js @@ -15,34 +15,12 @@ var __string = new String("one-1 two-2 four-4"); var __split = __string.split("-4"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one-1 two-2 four-4"); __split = __string.split("-4"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 2) { - $ERROR('#2: var __string = new String("one-1 two-2 four-4"); __split = __string.split("-4"); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "one-1 two-2 four") { - $ERROR('#3: var __string = new String("one-1 two-2 four-4"); __split = __string.split("-4"); __split[0] === "one-1 two-2 four". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#3: var __string = new String("one-1 two-2 four-4"); __split = __string.split("-4"); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "one-1 two-2 four", 'The value of __split[0] is "one-1 two-2 four"'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T14.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T14.js index ec0899acb8..2fd31012aa 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T14.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T14.js @@ -15,34 +15,12 @@ var __string = new String("one-1 two-2 four-4"); var __split = __string.split("on"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one-1 two-2 four-4"); __split = __string.split("on"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 2) { - $ERROR('#2: var __string = new String("one-1 two-2 four-4"); __split = __string.split("on"); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "") { - $ERROR('#3: var __string = new String("one-1 two-2 four-4"); __split = __string.split("on"); __split[0] === "". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "e-1 two-2 four-4") { - $ERROR('#4: var __string = new String("one-1 two-2 four-4"); __split = __string.split("on"); __split[1] === "e-1 two-2 four-4". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "", 'The value of __split[0] is ""'); +assert.sameValue(__split[1], "e-1 two-2 four-4", 'The value of __split[1] is "e-1 two-2 four-4"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T15.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T15.js index 2a580f29e0..e0e40ef4a5 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T15.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T15.js @@ -15,26 +15,11 @@ var __string = new String(); var __split = __string.split(""); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String(); __split = __string.split(""); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 0) { - $ERROR('#2: var __string = new String(); __split = __string.split(""); __split.length === 0. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== undefined) { - $ERROR('#3: var __string = new String(); __split = __string.split(""); __split[0] === undefined. Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 0, 'The value of __split.length is 0'); +assert.sameValue(__split[0], undefined, 'The value of __split[0] is expected to equal `undefined`'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T16.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T16.js index 4a3bceb58b..2b2513656f 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T16.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T16.js @@ -15,26 +15,11 @@ var __string = new String(); var __split = __string.split(" "); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String(); __split = __string.split(" "); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String(); __split = __string.split(" "); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "") { - $ERROR('#3: var __string = new String(); __split = __string.split(" "); __split[0] === "". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "", 'The value of __split[0] is ""'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T17.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T17.js index e76f256882..68a2d943e2 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T17.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T17.js @@ -15,26 +15,11 @@ var __string = new String(" "); var __split = __string.split(""); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String(" "); __split = __string.split(""); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String(" "); __split = __string.split(""); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== " ") { - $ERROR('#3: var __string = new String(" "); __split = __string.split(""); __split[0] === " ". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], " ", 'The value of __split[0] is " "'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T18.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T18.js index 65971fdd32..aa4d5b39bf 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T18.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T18.js @@ -15,34 +15,12 @@ var __string = new String(" "); var __split = __string.split(" "); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String(" "); __split = __string.split(" "); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 2) { - $ERROR('#2: var __string = new String(" "); __split = __string.split(" "); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "") { - $ERROR('#3: var __string = new String(" "); __split = __string.split(" "); __split[0] === "". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#4: var __string = new String(" "); __split = __string.split(" "); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "", 'The value of __split[0] is ""'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T19.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T19.js index b9a9b2a740..1a0cdda299 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T19.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T19.js @@ -15,26 +15,11 @@ var __string = ""; var __split = __string.split("x"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = ""; __split = __string.split("x"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = ""; __split = __string.split("x"); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "") { - $ERROR('#3: var __string = ""; __split = __string.split("x"); __split[0] === "". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "", 'The value of __split[0] is ""'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T2.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T2.js index bedfcf81b5..acf01bfc07 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T2.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T2.js @@ -15,58 +15,15 @@ var __string = new String("one two three four five"); var __split = __string.split(" "); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one two three four five"); __split = __string.split(" "); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 5) { - $ERROR('#2: var __string = new String("one two three four five"); __split = __string.split(" "); __split.length === 5. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "one") { - $ERROR('#3: var __string = new String("one two three four five"); __split = __string.split(" "); __split[0] === "one". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "two") { - $ERROR('#4: var __string = new String("one two three four five"); __split = __string.split(" "); __split[1] === "two". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[2] !== "three") { - $ERROR('#5: var __string = new String("one two three four five"); __split = __string.split(" "); __split[2] === "three". Actual: ' + __split[2]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#6 -if (__split[3] !== "four") { - $ERROR('#6: var __string = new String("one two three four five"); __split = __string.split(" "); __split[3] === "four". Actual: ' + __split[3]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#7 -if (__split[4] !== "five") { - $ERROR('#7: var __string = new String("one two three four five"); __split = __string.split(" "); __split[4] === "five". Actual: ' + __split[4]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 5, 'The value of __split.length is 5'); +assert.sameValue(__split[0], "one", 'The value of __split[0] is "one"'); +assert.sameValue(__split[1], "two", 'The value of __split[1] is "two"'); +assert.sameValue(__split[2], "three", 'The value of __split[2] is "three"'); +assert.sameValue(__split[3], "four", 'The value of __split[3] is "four"'); +assert.sameValue(__split[4], "five", 'The value of __split[4] is "five"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T20.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T20.js index b927eeb09b..96b261cf45 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T20.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T20.js @@ -15,28 +15,25 @@ var __string = new String("one-1 two-2 three-3"); var __split = __string.split(new RegExp); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one-1 two-2 three-3"); __split = __string.split(new RegExp); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __string.length, + 'The value of __split.length is expected to equal the value of __string.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __string.length) { - $ERROR('#2: var __string = new String("one-1 two-2 three-3"); __split = __string.split(new RegExp); __split.length === __string.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var i = 0; i < __string.length; i++) { - if (__string.charAt(i) !== __split[i]) { - $ERROR('#3.' + i + ': var __string = new String("one-1 two-2 three-3"); __split = __string.split(new RegExp); __string.charAt(' + i + ')===__split[' + i + ']. Actual: ' + __string.charAt(i)); - } + assert.sameValue(__string.charAt(i), __split[i], '__string.charAt("0") must return the value of __split[i]'); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T21.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T21.js index dfe48ffd39..1aaeb3e7b4 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T21.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T21.js @@ -15,34 +15,12 @@ var __string = new String("hello"); var __split = __string.split("ll"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); __split = __string.split("ll"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 2) { - $ERROR('#2: var __string = new String("hello"); __split = __string.split("ll"); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "he") { - $ERROR('#3: var __string = new String("hello"); __split = __string.split("ll"); __split[0] === "he". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "o") { - $ERROR('#4: var __string = new String("hello"); __split = __string.split("ll"); __split[1] === "o". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "he", 'The value of __split[0] is "he"'); +assert.sameValue(__split[1], "o", 'The value of __split[1] is "o"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T22.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T22.js index 2000c8067c..02016b6043 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T22.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T22.js @@ -15,42 +15,13 @@ var __string = new String("hello"); var __split = __string.split("l"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); __split = __string.split("l"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 3) { - $ERROR('#2: var __string = new String("hello"); __split = __string.split("l"); __split.length === 3. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "he") { - $ERROR('#3: var __string = new String("hello"); __split = __string.split("l"); __split[0] === "he". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#4: var __string = new String("hello"); __split = __string.split("l"); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[2] !== "o") { - $ERROR('#5: var __string = new String("hello"); __split = __string.split("l"); __split[2] === "o". Actual: ' + __split[2]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 3, 'The value of __split.length is 3'); +assert.sameValue(__split[0], "he", 'The value of __split[0] is "he"'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); +assert.sameValue(__split[2], "o", 'The value of __split[2] is "o"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T23.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T23.js index 495b83a60a..59c1106ae4 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T23.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T23.js @@ -15,26 +15,11 @@ var __string = new String("hello"); var __split = __string.split("x"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); __split = __string.split("x"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String("hello"); __split = __string.split("x"); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "hello") { - $ERROR('#3: var __string = new String("hello"); __split = __string.split("x"); __split[0] === "hello". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "hello", 'The value of __split[0] is "hello"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T24.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T24.js index 49c6a0f1cd..3039eec9bd 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T24.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T24.js @@ -15,34 +15,12 @@ var __string = new String("hello"); var __split = __string.split("h"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); __split = __string.split("h"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 2) { - $ERROR('#2: var __string = new String("hello"); __split = __string.split("h"); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "") { - $ERROR('#3: var __string = new String("hello"); __split = __string.split("h"); __split[0] === "". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "ello") { - $ERROR('#4: var __string = new String("hello"); __split = __string.split("h"); __split[1] === "ello". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "", 'The value of __split[0] is ""'); +assert.sameValue(__split[1], "ello", 'The value of __split[1] is "ello"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T25.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T25.js index ae70cca74a..97e289a28e 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T25.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T25.js @@ -15,34 +15,12 @@ var __string = new String("hello"); var __split = __string.split("o"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); __split = __string.split("o"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 2) { - $ERROR('#2: var __string = new String("hello"); __split = __string.split("o"); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "hell") { - $ERROR('#3: var __string = new String("hello"); __split = __string.split("o"); __split[0] === "hell". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#4: var __string = new String("hello"); __split = __string.split("o"); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "hell", 'The value of __split[0] is "hell"'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T26.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T26.js index 3646139de6..725551a4ee 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T26.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T26.js @@ -15,34 +15,12 @@ var __string = new String("hello"); var __split = __string.split("hello"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); __split = __string.split("hello"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 2) { - $ERROR('#2: var __string = new String("hello"); __split = __string.split("hello"); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "") { - $ERROR('#3: var __string = new String("hello"); __split = __string.split("hello"); __split[0] === "". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#4: var __string = new String("hello"); __split = __string.split("hello"); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "", 'The value of __split[0] is ""'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T27.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T27.js index c7fd8c5460..8e551e1247 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T27.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T27.js @@ -15,26 +15,11 @@ var __string = new String("hello"); var __split = __string.split(undefined); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); __split = __string.split(undefined); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String("hello"); __split = __string.split(undefined); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "hello") { - $ERROR('#3: var __string = new String("hello"); __split = __string.split(undefined); __split[0] === "hello". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "hello", 'The value of __split[0] is "hello"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T28.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T28.js index 6ef0a46570..826e95403a 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T28.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T28.js @@ -15,26 +15,11 @@ var __string = new String("hello"); var __split = __string.split("hellothere"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); __split = __string.split("hellothere"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String("hello"); __split = __string.split("hellothere"); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "hello") { - $ERROR('#3: var __string = new String("hello"); __split = __string.split("hellothere"); __split[0] === "hello". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "hello", 'The value of __split[0] is "hello"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T29.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T29.js index fa342d6324..b04920717d 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T29.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T29.js @@ -19,28 +19,29 @@ var __split = __instance.split(1); var __expected = ["", "00", "", "", "", "22", "33", "44", "60"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T3.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T3.js index 6dd024d4ab..3f9a3da516 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T3.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T3.js @@ -15,34 +15,12 @@ var __string = new String("one two three four five"); var __split = __string.split(/ /, 2); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one two three four five"); __split = __string.split(/ /,2); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 2) { - $ERROR('#2: var __string = new String("one two three four five"); __split = __string.split(/ /,2); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "one") { - $ERROR('#3: var __string = new String("one two three four five"); __split = __string.split(/ /,2); __split[0] === "one". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "two") { - $ERROR('#4: var __string = new String("one two three four five"); __split = __string.split(/ /,2); __split[1] === "two". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "one", 'The value of __split[0] is "one"'); +assert.sameValue(__split[1], "two", 'The value of __split[1] is "two"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T30.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T30.js index 5323ad0721..e0e8a45ddc 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T30.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T30.js @@ -19,26 +19,16 @@ var __split = __instance.split(1, 1); var __expected = [""]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __expected[0]) { - $ERROR('#3: __split[0] === ' + __expected[0] + '. Actual: ' + __split[index]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split[0], __expected[0], 'The value of __split[0] is expected to equal the value of __expected[0]'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T31.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T31.js index 15adead0fa..b212e9382e 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T31.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T31.js @@ -19,28 +19,29 @@ var __split = __instance.split(1, 2); var __expected = ["", "00"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[index] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T32.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T32.js index 208852941e..35b7d7214c 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T32.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T32.js @@ -19,26 +19,16 @@ var __split = __instance.split(1, 0); var __expected = []; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __expected[0]) { - $ERROR('#3: __split[0] === ' + __expected[0] + '. Actual: ' + __split[index]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split[0], __expected[0], 'The value of __split[0] is expected to equal the value of __expected[0]'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T33.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T33.js index 3d12696379..6aab1e1ded 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T33.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T33.js @@ -19,28 +19,29 @@ var __split = __instance.split(1, 100); var __expected = ["", "00", "", "", "", "22", "33", "44", "60"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[index] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T34.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T34.js index c40f3993a6..8a1dca5efd 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T34.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T34.js @@ -19,28 +19,29 @@ var __split = __instance.split(1, void 0); var __expected = ["", "00", "", "", "", "22", "33", "44", "60"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3: __split[index] === __expected[index]. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T35.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T35.js index c82748bf23..3fc7b5fa61 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T35.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T35.js @@ -19,28 +19,29 @@ var __split = __instance.split(1, Math.pow(2, 32) - 1); var __expected = ["", "00", "", "", "", "22", "33", "44", "60"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[index] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T36.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T36.js index 20e3e84f2d..7af67c1bc8 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T36.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T36.js @@ -19,26 +19,16 @@ var __split = __instance.split(1, "boo"); var __expected = []; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __expected[0]) { - $ERROR('#3: __split[0] === ' + __expected[0] + '. Actual: ' + __split[index]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split[0], __expected[0], 'The value of __split[0] is expected to equal the value of __expected[0]'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T37.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T37.js index 1fa443388c..b985752a56 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T37.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T37.js @@ -19,26 +19,16 @@ var __split = __instance.split(1, -Math.pow(2, 32) + 1); var __expected = [""]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __expected[0]) { - $ERROR('#3: __split[0] === ' + __expected[0] + '. Actual: ' + __split[index]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split[0], __expected[0], 'The value of __split[0] is expected to equal the value of __expected[0]'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T38.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T38.js index fd0b4b97a7..62a539b3e7 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T38.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T38.js @@ -17,25 +17,16 @@ var __split = __instance.split("l", NaN); var __expected = []; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", NaN); __expected = []; __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", NaN); __expected = []; __split.length === __expected.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __expected[0]) { - $ERROR('#3: var __instance = new String("hello"); __split = __instance.split("l", NaN); __expected = []; __split[0] === ' + __expected[0] + '. Actual: ' + __split[index]); -} -// +assert.sameValue(__split[0], __expected[0], 'The value of __split[0] is expected to equal the value of __expected[0]'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T39.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T39.js index ee012e98d5..f4c47f96ca 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T39.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T39.js @@ -17,25 +17,16 @@ var __split = __instance.split("l", 0); var __expected = []; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", 0); __expected = []; __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", 0); __expected = []; __split.length === __expected.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __expected[0]) { - $ERROR('#3: var __instance = new String("hello"); __split = __instance.split("l", 0); __expected = []; __split[0] === ' + __expected[0] + '. Actual: ' + __split[index]); -} -// +assert.sameValue(__split[0], __expected[0], 'The value of __split[0] is expected to equal the value of __expected[0]'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T4.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T4.js index 69bed20441..2c1674e762 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T4.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T4.js @@ -15,50 +15,19 @@ var __string = new String("one two three"); var __split = __string.split(""); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one two three"); __split = __string.split(""); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __string.length) { - $ERROR('#2: var __string = new String("one two three"); __split = __string.split(""); __split.length === __string.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __string.length, + 'The value of __split.length is expected to equal the value of __string.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "o") { - $ERROR('#3: var __string = new String("one two three"); __split = __string.split(""); __split[0] === "o". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "n") { - $ERROR('#4: var __string = new String("one two three"); __split = __string.split(""); __split[1] === "n". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[11] !== "e") { - $ERROR('#5: var __string = new String("one two three"); __split = __string.split(""); __split[11] === "e". Actual: ' + __split[11]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#6 -if (__split[12] !== "e") { - $ERROR('#6: var __string = new String("one two three"); __split = __string.split(""); __split[12] === "e". Actual: ' + __split[12]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split[0], "o", 'The value of __split[0] is "o"'); +assert.sameValue(__split[1], "n", 'The value of __split[1] is "n"'); +assert.sameValue(__split[11], "e", 'The value of __split[11] is "e"'); +assert.sameValue(__split[12], "e", 'The value of __split[12] is "e"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T40.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T40.js index 2f11e0f0f8..7d43b795a7 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T40.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T40.js @@ -17,25 +17,16 @@ var __split = __instance.split("l", 1); var __expected = ["he"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", 1); __expected = ["he"]; __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", 1); __expected = ["he"]; __split.length === __expected.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __expected[0]) { - $ERROR('#3: var __instance = new String("hello"); __split = __instance.split("l", 1); __expected = ["he"]; __split[0] === ' + __expected[0] + '. Actual: ' + __split[index]); -} -// +assert.sameValue(__split[0], __expected[0], 'The value of __split[0] is expected to equal the value of __expected[0]'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T41.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T41.js index d8e21db1e7..924fc12eab 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T41.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T41.js @@ -17,28 +17,29 @@ var __split = __instance.split("l", 2); var __expected = ["he", ""]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", 2); __expected = ["he",""]; __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", 2); __expected = ["he",""]; __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': var __instance = new String("hello"); __split = __instance.split("l", 2); __expected = ["he",""]; __split[index] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T42.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T42.js index 5b9b69fc83..f65b1da0b2 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T42.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T42.js @@ -17,28 +17,29 @@ var __split = __instance.split("l", 3); var __expected = ["he", "", "o"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", 3); __expected = ["he","","o"]; __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", 3); __expected = ["he","","o"]; __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': var __instance = new String("hello"); __split = __instance.split("l", 3); __expected = ["he","","o"]; __split[index] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T43.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T43.js index 1ec04cfc40..a3fd772fff 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T43.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T43.js @@ -17,28 +17,29 @@ var __split = __instance.split("l", 4); var __expected = ["he", "", "o"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new String("hello"); __split = __instance.split("l", 4); __expected = ["he","","o"]; __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: var __instance = new String("hello"); __split = __instance.split("l", 4); __expected = ["he","","o"]; __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': var __instance = new String("hello"); __split = __instance.split("l", 4); __expected = ["he","","o"]; __split[index] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T5.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T5.js index 1c8618b6d1..0a0b27ba66 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T5.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T5.js @@ -15,42 +15,13 @@ var __string = new String("one-1,two-2,four-4"); var __split = __string.split(/,/); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one-1,two-2,four-4"); __split = __string.split(/,/); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 3) { - $ERROR('#2: var __string = new String("one-1,two-2,four-4"); __split = __string.split(/,/); __split.length === 3. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "one-1") { - $ERROR('#3: var __string = new String("one-1,two-2,four-4"); __split = __string.split(/,/); __split[0] === "one-1". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "two-2") { - $ERROR('#4: var __string = new String("one-1,two-2,four-4"); __split = __string.split(/,/); __split[1] === "two-2". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[2] !== "four-4") { - $ERROR('#5: var __string = new String("one-1,two-2,four-4"); __split = __string.split(/,/); __split[2] === "four-4". Actual: ' + __split[2]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 3, 'The value of __split.length is 3'); +assert.sameValue(__split[0], "one-1", 'The value of __split[0] is "one-1"'); +assert.sameValue(__split[1], "two-2", 'The value of __split[1] is "two-2"'); +assert.sameValue(__split[2], "four-4", 'The value of __split[2] is "four-4"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T6.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T6.js index e9d469d4ab..a51c7586c2 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T6.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T6.js @@ -15,28 +15,29 @@ var __string = new String("one-1 two-2 three-3"); var __split = __string.split(''); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one-1 two-2 three-3"); __split = __string.split(\'\'); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __string.length, + 'The value of __split.length is expected to equal the value of __string.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __string.length) { - $ERROR('#2: var __string = new String("one-1 two-2 three-3"); __split = __string.split(\'\'); __split.length === __string.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var i = 0; i < __string.length; i++) { - if (__split[i] !== __string.charAt(i)) { - $ERROR('#3.' + i + ': var __string = new String("one-1 two-2 three-3"); __split = __string.split(\'\'); __split[' + i + ']===__string.charAt(' + i + '). Actual: ' + __split[i]); - } + assert.sameValue( + __split[i], + __string.charAt(i), + 'The value of __split[i] must return the same value returned by __string.charAt(i)' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T7.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T7.js index e0e5f0ca32..d9694539df 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T7.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T7.js @@ -18,28 +18,25 @@ var __expected = [__string]; var __split = __string.split(void 0); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["thisundefinedisundefinedaundefinedstringundefinedobject"]; __split = __string.split(void 0); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["thisundefinedisundefinedaundefinedstringundefinedobject"]; __split = __string.split(void 0); __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var i = 0; i < __expected.length; i++) { - if (__expected[i] !== __split[i]) { - $ERROR('#3.' + i + ': var __string = "thisundefinedisundefinedaundefinedstringundefinedobject"; var __expected = ["thisundefinedisundefinedaundefinedstringundefinedobject"]; __split = __string.split(void 0); __expected[' + i + ']===' + __split[i] + '. Actual: ' + __expected[i]); - } + assert.sameValue(__expected[i], __split[i], 'The value of __expected[i] is expected to equal the value of __split[i]'); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T8.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T8.js index ec0170f44a..b617de2cd1 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T8.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T8.js @@ -16,28 +16,25 @@ var __expected = ["this", "is", "a", "string", "object"]; var __split = __string.split(null); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = "thisnullisnullanullstringnullobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(null); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: var __string = "thisnullisnullanullstringnullobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(null); __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var i = 0; i < __expected.length; i++) { - if (__expected[i] !== __split[i]) { - $ERROR('#3.' + i + ': var __string = "thisnullisnullanullstringnullobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(null); __expected[' + i + ']===' + __split[i] + '. Actual: ' + __expected[i]); - } + assert.sameValue(__expected[i], __split[i], 'The value of __expected[i] is expected to equal the value of __split[i]'); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T9.js b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T9.js index 8d7da32def..c5d384977b 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A2_T9.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A2_T9.js @@ -16,28 +16,25 @@ var __expected = ["this", "is", "a", "string", "object"]; var __split = __string.split(true); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = "thistrueistrueatruestringtrueobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(true); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: var __string = "thistrueistrueatruestringtrueobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(true); __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var i = 0; i < __expected.length; i++) { - if (__expected[i] !== __split[i]) { - $ERROR('#3.' + i + ': var __string = "thistrueistrueatruestringtrueobject"; var __expected = ["this", "is", "a", "string", "object"]; __split = __string.split(true); __expected[' + i + ']===' + __split[i] + '. Actual: ' + __expected[i]); - } + assert.sameValue(__expected[i], __split[i], 'The value of __expected[i] is expected to equal the value of __split[i]'); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T1.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T1.js index f9494680cb..2903d13c2d 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T1.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T1.js @@ -14,26 +14,11 @@ var __string = new String("one,two,three,four,five"); var __split = __string.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("one,two,three,four,five"); __split = __string.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String("one,two,three,four,five"); __split = __string.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "one,two,three,four,five") { - $ERROR('#3: var __string = new String("one,two,three,four,five"); __split = __string.split(); __split[0] === "one,two,three,four,five". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "one,two,three,four,five", 'The value of __split[0] is "one,two,three,four,five"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T10.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T10.js index 0958d37c50..3ba8628ddd 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T10.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T10.js @@ -14,26 +14,11 @@ var __string = new String; var __split = __string.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String; __split = __string.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String; __split = __string.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "") { - $ERROR('#3: var __string = new String; __split = __string.split(); __split[0] === "". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "", 'The value of __split[0] is ""'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T11.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T11.js index 07f2d68c3e..cdf6f08700 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T11.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T11.js @@ -14,26 +14,11 @@ var __string = new String(" "); var __split = __string.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String(" "); __split = __string.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String(" "); __split = __string.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== " ") { - $ERROR('#3: var __string = new String(" "); __split = __string.split(); __split[0] === " ". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], " ", 'The value of __split[0] is " "'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T2.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T2.js index 58670f6d03..cb2684a632 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T2.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T2.js @@ -16,26 +16,11 @@ __instance.split = String.prototype.split; var __split = __instance.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new Object(); __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __instance = new Object(); __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "[object Object]") { - $ERROR('#3: var __instance = new Object(); __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "[object Object]". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "[object Object]", 'The value of __split[0] is "[object Object]"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T3.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T3.js index 137d8465a7..20fa5fd175 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T3.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T3.js @@ -20,26 +20,11 @@ __instance.split = String.prototype.split; var __split = __instance.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = function(){}; __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __instance = function(){}; __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0].substring(0, 8) !== "function") { - $ERROR('#3: var __instance = function(){}; __instance.split = String.prototype.split; __split = __instance.split(); __split[0].substring(0,8) === "function". Actual: ' + __split[0].substring(0, 8)); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0].substring(0, 8), "function", '__split[0].substring(0, 8) must return "function"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T4.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T4.js index 36f0fb2b2b..d713af6493 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T4.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T4.js @@ -16,26 +16,11 @@ __instance.split = String.prototype.split; var __split = __instance.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new Number(NaN); __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __instance = new Number(NaN); __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "NaN") { - $ERROR('#3: var __instance = new Number(NaN); __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "NaN". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "NaN", 'The value of __split[0] is "NaN"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T5.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T5.js index ad0cdda568..18585da715 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T5.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T5.js @@ -16,26 +16,11 @@ __instance.split = String.prototype.split; var __split = __instance.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new Number(-1234567890); __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __instance = new Number(-1234567890); __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "-1234567890") { - $ERROR('#3: var __instance = new Number(-1234567890); __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "-1234567890". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "-1234567890", 'The value of __split[0] is "-1234567890"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T6.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T6.js index c68a29ee18..8ee733701e 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T6.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T6.js @@ -16,26 +16,16 @@ __instance.split = String.prototype.split; var __split = __instance.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new Number(-1e21); __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __instance = new Number(-1e21); __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __instance.toString()) { - $ERROR('#3: var __instance = new Number(-1e21); __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === __instance.toString(). Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split[0], + __instance.toString(), + 'The value of __split[0] must return the same value returned by __instance.toString()' +); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T7.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T7.js index 661bf4e36d..72e7679804 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T7.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T7.js @@ -16,26 +16,11 @@ __instance.split = String.prototype.split; var __split = __instance.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = Math; __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __instance = Math; __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "[object Math]") { - $ERROR('#3: var __instance = Math; __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "[object Math]". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "[object Math]", 'The value of __split[0] is "[object Math]"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T8.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T8.js index e1a309ef25..8462bab60f 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T8.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T8.js @@ -16,26 +16,11 @@ __instance.split = String.prototype.split; var __split = __instance.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new Array(1,2,3,4,5); __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __instance = new Array(1,2,3,4,5); __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "1,2,3,4,5") { - $ERROR('#3: var __instance = new Array(1,2,3,4,5); __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "1,2,3,4,5". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "1,2,3,4,5", 'The value of __split[0] is "1,2,3,4,5"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T9.js b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T9.js index b3bf706cf3..5e858ed812 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A3_T9.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A3_T9.js @@ -16,26 +16,11 @@ __instance.split = String.prototype.split; var __split = __instance.split(); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split(); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split(); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "false") { - $ERROR('#3: var __instance = new Boolean; __instance.split = String.prototype.split; __split = __instance.split(); __split[0] === "false". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "false", 'The value of __split[0] is "false"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T1.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T1.js index 8306e88d7f..0b67801199 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T1.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T1.js @@ -16,42 +16,13 @@ var __re = /l/; var __split = __string.split(__re); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 3) { - $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re); __split.length === 3. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "he") { - $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re); __split[0] === "he". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[2] !== "o") { - $ERROR('#5: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re); __split[2] === "o". Actual: ' + __split[2]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 3, 'The value of __split.length is 3'); +assert.sameValue(__split[0], "he", 'The value of __split[0] is "he"'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); +assert.sameValue(__split[2], "o", 'The value of __split[2] is "o"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T10.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T10.js index 296ac5ee5e..33fda3bb3e 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T10.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T10.js @@ -18,28 +18,29 @@ var __split = __string.split(__re); var __expected = ["h", "e", "l", "l", "o"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T11.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T11.js index 32503116d5..b794a34046 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T11.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T11.js @@ -18,26 +18,16 @@ var __split = __string.split(__re, 0); var __expected = []; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __expected[0]) { - $ERROR('#3: __split[0] === ' + __expected[0] + '. Actual: ' + __split[index]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split[0], __expected[0], 'The value of __split[0] is expected to equal the value of __expected[0]'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T12.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T12.js index 05cc593e54..4b7a3ecc73 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T12.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T12.js @@ -18,26 +18,16 @@ var __split = __string.split(__re, 1); var __expected = ["h"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __expected[0]) { - $ERROR('#3: __split[0] === ' + __expected[0] + '. Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split[0], __expected[0], 'The value of __split[0] is expected to equal the value of __expected[0]'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T13.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T13.js index 72683da883..badb1ebaa1 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T13.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T13.js @@ -18,28 +18,29 @@ var __split = __string.split(__re, 2); var __expected = ["h", "e"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T14.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T14.js index a3e264a31b..1a5660dac4 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T14.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T14.js @@ -18,28 +18,29 @@ var __split = __string.split(__re, 3); var __expected = ["h", "e", "l"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T15.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T15.js index 88d744ae39..f34fe46008 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T15.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T15.js @@ -18,28 +18,29 @@ var __split = __string.split(__re, 4); var __expected = ["h", "e", "l", "l"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T16.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T16.js index b97b9aa5dd..407ce8befa 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T16.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T16.js @@ -20,28 +20,29 @@ var __split = __string.split(__re, void 0); var __expected = ["h", "e", "l", "l", "o"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T17.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T17.js index 5fecb0dcad..5171f16e16 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T17.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T17.js @@ -20,28 +20,29 @@ var __split = __string.split(__re, undefined); var __expected = ["h", "e", "l", "l", "o"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T18.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T18.js index 68a70929ce..99a41a3cff 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T18.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T18.js @@ -18,28 +18,29 @@ var __split = __string.split(__re, "hi"); var __expected = []; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T19.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T19.js index 3df56dacfb..334c0de8f3 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T19.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T19.js @@ -18,28 +18,29 @@ var __split = __string.split(__re); var __expected = ["a", "b", "c", "de", "f"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T2.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T2.js index b6d9396e81..acbdba96c4 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T2.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T2.js @@ -16,18 +16,10 @@ var __re = /l/; var __split = __string.split(__re, 0); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,0); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 0) { - $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,0); __split.length === 0. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 0, 'The value of __split.length is 0'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T20.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T20.js index cddd4f260d..0489b0fec2 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T20.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T20.js @@ -20,28 +20,29 @@ var __split = __string.split(__re, 3); var __expected = ["a", "b", "c"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T21.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T21.js index 16485eb04c..125d4ba29b 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T21.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T21.js @@ -18,26 +18,16 @@ var __split = __string.split(__re); var __expected = ["a b c de f"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== __expected[0]) { - $ERROR('#3: __split[0] === ' + __expected[0] + '. Actual: ' + __split[index]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split[0], __expected[0], 'The value of __split[0] is expected to equal the value of __expected[0]'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T22.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T22.js index 8ab1e54bf1..5d56d0d125 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T22.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T22.js @@ -20,28 +20,29 @@ var __split = __string.split(__re); var __expected = ["dfe", "iu ", " =+", "--"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T23.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T23.js index 2118c1e0eb..402e2df4a3 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T23.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T23.js @@ -20,28 +20,29 @@ var __split = __string.split(__re); var __expected = ["dfe", "iu ", " =+", "--"]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T24.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T24.js index e946d99b5e..844e487e60 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T24.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T24.js @@ -18,28 +18,29 @@ var __split = __string.split(__re); var __expected = ["", "", "", ""]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T25.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T25.js index 59cc456a5e..3069ec0b3b 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T25.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T25.js @@ -18,28 +18,29 @@ var __split = __string.split(__re); var __expected = ["", "", "", ""]; -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); + +assert.sameValue( + __split.length, + __expected.length, + 'The value of __split.length is expected to equal the value of __expected.length' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== __expected.length) { - $ERROR('#2: __split.length === __expected.length. Actual: ' + __split.length); -} // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //CHECK#3 for (var index = 0; index < __expected.length; index++) { - if (__split[index] !== __expected[index]) { - $ERROR('#3.' + index + ': __split[' + index + '] === ' + __expected[index] + '. Actual: ' + __split[index]); - } + assert.sameValue( + __split[index], + __expected[index], + 'The value of __split[index] is expected to equal the value of __expected[index]' + ); } // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T3.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T3.js index 047e8d44e8..f31fdbb454 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T3.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T3.js @@ -16,26 +16,11 @@ var __re = /l/; var __split = __string.split(__re, 1); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,1); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 1) { - $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,1); __split.length === 1. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "he") { - $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,1); __split[0] === "he". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 1, 'The value of __split.length is 1'); +assert.sameValue(__split[0], "he", 'The value of __split[0] is "he"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T4.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T4.js index 4c713ecb85..40c5472e76 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T4.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T4.js @@ -16,34 +16,12 @@ var __re = /l/; var __split = __string.split(__re, 2); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,2); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 2) { - $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,2); __split.length === 2. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "he") { - $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,2); __split[0] === "he". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,2); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 2, 'The value of __split.length is 2'); +assert.sameValue(__split[0], "he", 'The value of __split[0] is "he"'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T5.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T5.js index ed78698657..d37093976d 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T5.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T5.js @@ -16,42 +16,13 @@ var __re = /l/; var __split = __string.split(__re, 3); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,3); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 3) { - $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,3); __split.length === 3. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "he") { - $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,3); __split[0] === "he". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,3); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[2] !== "o") { - $ERROR('#5: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,3); __split[2] === "o". Actual: ' + __split[2]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 3, 'The value of __split.length is 3'); +assert.sameValue(__split[0], "he", 'The value of __split[0] is "he"'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); +assert.sameValue(__split[2], "o", 'The value of __split[2] is "o"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T6.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T6.js index 0a8a68942f..2cefcea0ab 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T6.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T6.js @@ -16,42 +16,13 @@ var __re = /l/; var __split = __string.split(__re, 4); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,4); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 3) { - $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,4); __split.length === 3. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "he") { - $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,4); __split[0] === "he". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,4); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[2] !== "o") { - $ERROR('#5: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re,4); __split[2] === "o". Actual: ' + __split[2]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 3, 'The value of __split.length is 3'); +assert.sameValue(__split[0], "he", 'The value of __split[0] is "he"'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); +assert.sameValue(__split[2], "o", 'The value of __split[2] is "o"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T7.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T7.js index 85a4f3b34a..244fb39820 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T7.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T7.js @@ -18,42 +18,13 @@ var __re = /l/; var __split = __string.split(__re, void 0); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, void 0); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 3) { - $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, void 0); __split.length === 3. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "he") { - $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, void 0); __split[0] === "he". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, void 0); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[2] !== "o") { - $ERROR('#5: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, void 0); __split[2] === "o". Actual: ' + __split[2]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 3, 'The value of __split.length is 3'); +assert.sameValue(__split[0], "he", 'The value of __split[0] is "he"'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); +assert.sameValue(__split[2], "o", 'The value of __split[2] is "o"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T8.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T8.js index 4ecc5fac7d..e1cd6855e0 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T8.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T8.js @@ -16,18 +16,10 @@ var __re = /l/; var __split = __string.split(__re, "hi"); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, "hi"); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 0) { - $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, "hi"); __split.length === 0. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 0, 'The value of __split.length is 0'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T9.js b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T9.js index bea17ccf4e..4a70adde0d 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A4_T9.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A4_T9.js @@ -18,42 +18,13 @@ var __re = /l/; var __split = __string.split(__re, undefined); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (__split.constructor !== Array) { - $ERROR('#1: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, undefined); __split.constructor === Array. Actual: ' + __split.constructor); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + __split.constructor, + Array, + 'The value of __split.constructor is expected to equal the value of Array' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (__split.length !== 3) { - $ERROR('#2: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, undefined); __split.length === 3. Actual: ' + __split.length); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -if (__split[0] !== "he") { - $ERROR('#3: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, undefined); __split[0] === "he". Actual: ' + __split[0]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -if (__split[1] !== "") { - $ERROR('#4: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, undefined); __split[1] === "". Actual: ' + __split[1]); -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#5 -if (__split[2] !== "o") { - $ERROR('#5: var __string = new String("hello"); var __re = /l/; __split = __string.split(__re, undefined); __split[2] === "o". Actual: ' + __split[2]); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(__split.length, 3, 'The value of __split.length is 3'); +assert.sameValue(__split[0], "he", 'The value of __split[0] is "he"'); +assert.sameValue(__split[1], "", 'The value of __split[1] is ""'); +assert.sameValue(__split[2], "o", 'The value of __split[2] is "o"'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A6.js b/test/built-ins/String/prototype/split/S15.5.4.14_A6.js index 85d6a2e7c8..014cdfeb79 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A6.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A6.js @@ -7,10 +7,8 @@ es5id: 15.5.4.14_A6 description: Checking String.prototype.split.prototype ---*/ -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (String.prototype.split.prototype !== undefined) { - $ERROR('#1: String.prototype.split.prototype === undefined. Actual: ' + String.prototype.split.prototype); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue( + String.prototype.split.prototype, + undefined, + 'The value of String.prototype.split.prototype is expected to equal `undefined`' +); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A7.js b/test/built-ins/String/prototype/split/S15.5.4.14_A7.js index 13b7b1d0c3..7ec1623924 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A7.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A7.js @@ -11,7 +11,9 @@ var __FACTORY = String.prototype.split; try { var __instance = new __FACTORY; - $ERROR('#1: __FACTORY = String.prototype.split; "__instance = new __FACTORY" lead to throwing exception'); + Test262Error.thrower('#1: __FACTORY = String.prototype.split; "__instance = new __FACTORY" lead to throwing exception'); } catch (e) { - if (e instanceof Test262Error) throw e; + if (e instanceof Test262Error) { + throw e; + } } diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A8.js b/test/built-ins/String/prototype/split/S15.5.4.14_A8.js index 4f0cd21841..95e4ec3c88 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A8.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A8.js @@ -9,20 +9,16 @@ description: > fails ---*/ -////////////////////////////////////////////////////////////////////////////// -//CHECK#0 -if (!(String.prototype.split.hasOwnProperty('length'))) { - $ERROR('#0: String.prototype.split.hasOwnProperty(\'length\') return true. Actual: ' + String.prototype.split.hasOwnProperty('length')); -} -// -////////////////////////////////////////////////////////////////////////////// +assert( + String.prototype.split.hasOwnProperty('length'), + 'String.prototype.split.hasOwnProperty(\'length\') must return true' +); +assert( + !String.prototype.split.propertyIsEnumerable('length'), + 'The value of `!String.prototype.split.propertyIsEnumerable(\'length\')` is true' +); -////////////////////////////////////////////////////////////////////////////// -// CHECK#1 -if (String.prototype.split.propertyIsEnumerable('length')) { - $ERROR('#1: String.prototype.split.propertyIsEnumerable(\'length\') return false'); -} // ////////////////////////////////////////////////////////////////////////////// @@ -31,11 +27,9 @@ if (String.prototype.split.propertyIsEnumerable('length')) { var count = 0; for (var p in String.prototype.split) { - if (p === "length") count++; + if (p === "length") { + count++; + } } -if (count !== 0) { - $ERROR('#2: count=0; for (p in String.prototype.split){if (p==="length") count++;}; count === 0. Actual: ' + count); -} -// -////////////////////////////////////////////////////////////////////////////// +assert.sameValue(count, 0, 'The value of `count` is 0'); diff --git a/test/built-ins/String/prototype/split/S15.5.4.14_A9.js b/test/built-ins/String/prototype/split/S15.5.4.14_A9.js index 131d8017ee..5c65beb1c8 100644 --- a/test/built-ins/String/prototype/split/S15.5.4.14_A9.js +++ b/test/built-ins/String/prototype/split/S15.5.4.14_A9.js @@ -11,26 +11,14 @@ description: > fails ---*/ -////////////////////////////////////////////////////////////////////////////// -//CHECK#0 -if (!(String.prototype.split.hasOwnProperty('length'))) { - $ERROR('#0: String.prototype.split.hasOwnProperty(\'length\') return true. Actual: ' + String.prototype.split.hasOwnProperty('length')); -} -// -////////////////////////////////////////////////////////////////////////////// +assert( + String.prototype.split.hasOwnProperty('length'), + 'String.prototype.split.hasOwnProperty(\'length\') must return true' +); -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -if (!delete String.prototype.split.length) { - $ERROR('#1: delete String.prototype.split.length return true'); -} -// -////////////////////////////////////////////////////////////////////////////// +assert(delete String.prototype.split.length, 'The value of `delete String.prototype.split.length` is true'); -////////////////////////////////////////////////////////////////////////////// -//CHECK#2 -if (String.prototype.split.hasOwnProperty('length')) { - $ERROR('#2: delete String.prototype.split.length; String.prototype.split.hasOwnProperty(\'length\') return false. Actual: ' + String.prototype.split.hasOwnProperty('length')); -} -// -////////////////////////////////////////////////////////////////////////////// +assert( + !String.prototype.split.hasOwnProperty('length'), + 'The value of `!String.prototype.split.hasOwnProperty(\'length\')` is true' +);