diff --git a/test/built-ins/Array/15.4.5-1.js b/test/built-ins/Array/15.4.5-1.js index 6eb1ae1271..59692ed6e6 100644 --- a/test/built-ins/Array/15.4.5-1.js +++ b/test/built-ins/Array/15.4.5-1.js @@ -9,4 +9,4 @@ description: Array instances have [[Class]] set to 'Array' var a = []; var s = Object.prototype.toString.call(a); -assert.sameValue(s, '[object Array]', 's'); +assert.sameValue(s, '[object Array]', 'The value of s is expected to be "[object Array]"'); diff --git a/test/built-ins/Array/15.4.5.1-5-1.js b/test/built-ins/Array/15.4.5.1-5-1.js index d92747a324..b0907e396d 100644 --- a/test/built-ins/Array/15.4.5.1-5-1.js +++ b/test/built-ins/Array/15.4.5.1-5-1.js @@ -11,4 +11,4 @@ description: > var a = []; a[4294967295] = "not an array element"; -assert.sameValue(a[4294967295], "not an array element", 'a[4294967295]'); +assert.sameValue(a[4294967295], "not an array element", 'The value of a[4294967295] is expected to be "not an array element"'); diff --git a/test/built-ins/Array/15.4.5.1-5-2.js b/test/built-ins/Array/15.4.5.1-5-2.js index 27abd4c55b..8e60d6d8c6 100644 --- a/test/built-ins/Array/15.4.5.1-5-2.js +++ b/test/built-ins/Array/15.4.5.1-5-2.js @@ -11,4 +11,4 @@ description: > var a = [0, 1, 2]; a[4294967295] = "not an array element"; -assert.sameValue(a.length, 3, 'a.length'); +assert.sameValue(a.length, 3, 'The value of a.length is expected to be 3'); diff --git a/test/built-ins/Array/S15.4.1_A1.1_T1.js b/test/built-ins/Array/S15.4.1_A1.1_T1.js index e519a5f655..bb3cef639c 100644 --- a/test/built-ins/Array/S15.4.1_A1.1_T1.js +++ b/test/built-ins/Array/S15.4.1_A1.1_T1.js @@ -15,6 +15,10 @@ description: > //CHECK#1 Array.prototype.myproperty = 42; var x = Array(); -assert.sameValue(x.myproperty, 42); +assert.sameValue(x.myproperty, 42, 'The value of x.myproperty is expected to be 42'); -assert.sameValue(Object.prototype.hasOwnProperty.call(x, 'myproperty'), false); +assert.sameValue( + Object.prototype.hasOwnProperty.call(x, 'myproperty'), + false, + 'Object.prototype.hasOwnProperty.call(Array(), "myproperty") must return false' +); diff --git a/test/built-ins/Array/S15.4.1_A1.1_T2.js b/test/built-ins/Array/S15.4.1_A1.1_T2.js index 7633f6587d..85cbc27b57 100644 --- a/test/built-ins/Array/S15.4.1_A1.1_T2.js +++ b/test/built-ins/Array/S15.4.1_A1.1_T2.js @@ -13,13 +13,9 @@ description: Array.prototype.toString = Object.prototype.toString //CHECK#1 Array.prototype.toString = Object.prototype.toString; var x = Array(); -if (x.toString() !== "[object " + "Array" + "]") { - throw new Test262Error('#1: Array.prototype.toString = Object.prototype.toString; var x = Array(); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); -} +assert.sameValue(x.toString(), "[object Array]", 'x.toString() must return "[object Array]"'); //CHECK#2 Array.prototype.toString = Object.prototype.toString; var x = Array(0, 1, 2); -if (x.toString() !== "[object " + "Array" + "]") { - throw new Test262Error('#2: Array.prototype.toString = Object.prototype.toString; var x = Array(0,1,2); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); -} +assert.sameValue(x.toString(), "[object Array]", 'x.toString() must return "[object Array]"'); diff --git a/test/built-ins/Array/S15.4.1_A1.1_T3.js b/test/built-ins/Array/S15.4.1_A1.1_T3.js index cb586c8d46..21b852e671 100644 --- a/test/built-ins/Array/S15.4.1_A1.1_T3.js +++ b/test/built-ins/Array/S15.4.1_A1.1_T3.js @@ -10,7 +10,8 @@ es5id: 15.4.1_A1.1_T3 description: Checking use isPrototypeOf ---*/ -//CHECK#1 -if (Array.prototype.isPrototypeOf(Array()) !== true) { - throw new Test262Error('#1: Array.prototype.isPrototypeOf(Array()) === true. Actual: ' + (Array.prototype.isPrototypeOf(Array()))); -} +assert.sameValue( + Array.prototype.isPrototypeOf(Array()), + true, + 'Array.prototype.isPrototypeOf(Array()) must return true' +); diff --git a/test/built-ins/Array/S15.4.1_A1.2_T1.js b/test/built-ins/Array/S15.4.1_A1.2_T1.js index 5f28e62826..2cbe462f61 100644 --- a/test/built-ins/Array/S15.4.1_A1.2_T1.js +++ b/test/built-ins/Array/S15.4.1_A1.2_T1.js @@ -10,13 +10,9 @@ description: Checking use Object.prototype.toString //CHECK#1 var x = Array(); x.getClass = Object.prototype.toString; -if (x.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#1: var x = Array(); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass())); -} +assert.sameValue(x.getClass(), "[object Array]", 'x.getClass() must return "[object Array]"'); //CHECK#2 var x = Array(0, 1, 2); x.getClass = Object.prototype.toString; -if (x.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#2: var x = Array(0,1,2); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass())); -} +assert.sameValue(x.getClass(), "[object Array]", 'x.getClass() must return "[object Array]"'); diff --git a/test/built-ins/Array/S15.4.1_A1.3_T1.js b/test/built-ins/Array/S15.4.1_A1.3_T1.js index 75d858da40..5f2a2d0027 100644 --- a/test/built-ins/Array/S15.4.1_A1.3_T1.js +++ b/test/built-ins/Array/S15.4.1_A1.3_T1.js @@ -11,12 +11,5 @@ description: Checking case when Array constructor is given one argument var x = Array(2); -//CHECK#1 -if (x.length === 1) { - throw new Test262Error('#1: var x = Array(2); x.length !== 1'); -} - -//CHECK#2 -if (x[0] === 2) { - throw new Test262Error('#2: var x = Array(2); x[0] !== 2'); -} +assert.notSameValue(x.length, 1, 'The value of x.length is not 1'); +assert.notSameValue(x[0], 2, 'The value of x[0] is not 2'); diff --git a/test/built-ins/Array/S15.4.1_A2.1_T1.js b/test/built-ins/Array/S15.4.1_A2.1_T1.js index 223fa2fc98..80ac57fe06 100644 --- a/test/built-ins/Array/S15.4.1_A2.1_T1.js +++ b/test/built-ins/Array/S15.4.1_A2.1_T1.js @@ -8,18 +8,11 @@ info: | es5id: 15.4.1_A2.1_T1 description: Array constructor is given no arguments or at least two arguments ---*/ +assert.sameValue(Array().length, 0, 'The value of Array().length is expected to be 0'); +assert.sameValue(Array(0, 1, 0, 1).length, 4, 'The value of Array(0, 1, 0, 1).length is expected to be 4'); -//CHECK#1 -if (Array().length !== 0) { - throw new Test262Error('#1: (Array().length === 0. Actual: ' + (Array().length)); -} - -//CHECK#2 -if (Array(0, 1, 0, 1).length !== 4) { - throw new Test262Error('#2: (Array(0,1,0,1).length === 4. Actual: ' + (Array(0, 1, 0, 1).length)); -} - -//CHECK#3 -if (Array(undefined, undefined).length !== 2) { - throw new Test262Error('#3: (Array(undefined, undefined).length === 2. Actual: ' + (Array(undefined, undefined).length)); -} +assert.sameValue( + Array(undefined, undefined).length, + 2, + 'The value of Array(undefined, undefined).length is expected to be 2' +); diff --git a/test/built-ins/Array/S15.4.1_A2.2_T1.js b/test/built-ins/Array/S15.4.1_A2.2_T1.js index 117e8592f4..f06603341f 100644 --- a/test/built-ins/Array/S15.4.1_A2.2_T1.js +++ b/test/built-ins/Array/S15.4.1_A2.2_T1.js @@ -33,6 +33,4 @@ for (var i = 0; i < 100; i++) { } } -if (result !== true) { - throw new Test262Error('#1: x[i] === i. Actual: ' + (x[i])); -} +assert.sameValue(result, true, 'The value of result is expected to be true'); diff --git a/test/built-ins/Array/S15.4.1_A3.1_T1.js b/test/built-ins/Array/S15.4.1_A3.1_T1.js index 50e47e7820..7405640e50 100644 --- a/test/built-ins/Array/S15.4.1_A3.1_T1.js +++ b/test/built-ins/Array/S15.4.1_A3.1_T1.js @@ -9,12 +9,10 @@ es5id: 15.4.1_A3.1_T1 description: Checking use typeof, instanceof ---*/ -//CHECK#1 -if (typeof Array() !== "object") { - throw new Test262Error('#1: typeof Array() === "object". Actual: ' + (typeof Array())); -} +assert.sameValue(typeof Array(), "object", 'The value of `typeof Array()` is expected to be "object"'); -//CHECK#2 -if ((Array() instanceof Array) !== true) { - throw new Test262Error('#2: (Array() instanceof Array) === true. Actual: ' + (Array() instanceof Array)); -} +assert.sameValue( + Array() instanceof Array, + true, + 'The result of evaluating (Array() instanceof Array) is expected to be true' +); diff --git a/test/built-ins/Array/S15.4.2.1_A1.1_T1.js b/test/built-ins/Array/S15.4.2.1_A1.1_T1.js index e1ff60ef62..0237a68c51 100644 --- a/test/built-ins/Array/S15.4.2.1_A1.1_T1.js +++ b/test/built-ins/Array/S15.4.2.1_A1.1_T1.js @@ -15,11 +15,5 @@ description: > //CHECK#1 Array.prototype.myproperty = 1; var x = new Array(); -if (x.myproperty !== 1) { - throw new Test262Error('#1: Array.prototype.myproperty = 1; var x = new Array(); x.myproperty === 1. Actual: ' + (x.myproperty)); -} - -//CHECK#2 -if (x.hasOwnProperty('myproperty') !== false) { - throw new Test262Error('#2: Array.prototype.myproperty = 1; var x = new Array(); x.hasOwnProperty(\'myproperty\') === false. Actual: ' + (x.hasOwnProperty('myproperty'))); -} +assert.sameValue(x.myproperty, 1, 'The value of x.myproperty is expected to be 1'); +assert.sameValue(x.hasOwnProperty('myproperty'), false, 'x.hasOwnProperty("myproperty") must return false'); diff --git a/test/built-ins/Array/S15.4.2.1_A1.1_T2.js b/test/built-ins/Array/S15.4.2.1_A1.1_T2.js index 7ae477b065..61dff8e87f 100644 --- a/test/built-ins/Array/S15.4.2.1_A1.1_T2.js +++ b/test/built-ins/Array/S15.4.2.1_A1.1_T2.js @@ -13,13 +13,9 @@ description: Array.prototype.toString = Object.prototype.toString //CHECK#1 Array.prototype.toString = Object.prototype.toString; var x = new Array(); -if (x.toString() !== "[object " + "Array" + "]") { - throw new Test262Error('#1: Array.prototype.toString = Object.prototype.toString; var x = new Array(); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); -} +assert.sameValue(x.toString(), "[object Array]", 'x.toString() must return "[object Array]"'); //CHECK#2 Array.prototype.toString = Object.prototype.toString; var x = new Array(0, 1, 2); -if (x.toString() !== "[object " + "Array" + "]") { - throw new Test262Error('#2: Array.prototype.toString = Object.prototype.toString; var x = new Array(0,1,2); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); -} +assert.sameValue(x.toString(), "[object Array]", 'x.toString() must return "[object Array]"'); diff --git a/test/built-ins/Array/S15.4.2.1_A1.1_T3.js b/test/built-ins/Array/S15.4.2.1_A1.1_T3.js index 9175ef79bc..3e6cb3cce0 100644 --- a/test/built-ins/Array/S15.4.2.1_A1.1_T3.js +++ b/test/built-ins/Array/S15.4.2.1_A1.1_T3.js @@ -9,8 +9,8 @@ info: | es5id: 15.4.2.1_A1.1_T3 description: Checking use isPrototypeOf ---*/ - -//CHECK#1 -if (Array.prototype.isPrototypeOf(new Array()) !== true) { - throw new Test262Error('#1: Array.prototype.isPrototypeOf(new Array()) === true. Actual: ' + (Array.prototype.isPrototypeOf(new Array()))); -} +assert.sameValue( + Array.prototype.isPrototypeOf(new Array()), + true, + 'Array.prototype.isPrototypeOf(new Array()) must return true' +); diff --git a/test/built-ins/Array/S15.4.2.1_A1.2_T1.js b/test/built-ins/Array/S15.4.2.1_A1.2_T1.js index 3f9c18a715..a6f53cf277 100644 --- a/test/built-ins/Array/S15.4.2.1_A1.2_T1.js +++ b/test/built-ins/Array/S15.4.2.1_A1.2_T1.js @@ -10,13 +10,9 @@ description: Checking use Object.prototype.toString //CHECK#1 var x = new Array(); x.getClass = Object.prototype.toString; -if (x.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#1: var x = new Array(); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass())); -} +assert.sameValue(x.getClass(), "[object Array]", 'x.getClass() must return "[object Array]"'); //CHECK#2 var x = new Array(0, 1, 2); x.getClass = Object.prototype.toString; -if (x.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#2: var x = new Array(0,1,2); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass())); -} +assert.sameValue(x.getClass(), "[object Array]", 'x.getClass() must return "[object Array]"'); diff --git a/test/built-ins/Array/S15.4.2.1_A1.3_T1.js b/test/built-ins/Array/S15.4.2.1_A1.3_T1.js index 673cfcb253..b34a497abd 100644 --- a/test/built-ins/Array/S15.4.2.1_A1.3_T1.js +++ b/test/built-ins/Array/S15.4.2.1_A1.3_T1.js @@ -11,12 +11,5 @@ description: Checking case when Array constructor is given one argument var x = new Array(2); -//CHECK#1 -if (x.length === 1) { - throw new Test262Error('#1: var x = new Array(2); x.length !== 1'); -} - -//CHECK#2 -if (x[0] === 2) { - throw new Test262Error('#2: var x = new Array(2); x[0] !== 2'); -} +assert.notSameValue(x.length, 1, 'The value of x.length is not 1'); +assert.notSameValue(x[0], 2, 'The value of x[0] is not 2'); diff --git a/test/built-ins/Array/S15.4.2.1_A2.1_T1.js b/test/built-ins/Array/S15.4.2.1_A2.1_T1.js index 9c307a48ef..c245c96937 100644 --- a/test/built-ins/Array/S15.4.2.1_A2.1_T1.js +++ b/test/built-ins/Array/S15.4.2.1_A2.1_T1.js @@ -8,18 +8,11 @@ info: | es5id: 15.4.2.1_A2.1_T1 description: Array constructor is given no arguments or at least two arguments ---*/ +assert.sameValue(new Array().length, 0, 'The value of new Array().length is expected to be 0'); +assert.sameValue(new Array(0, 1, 0, 1).length, 4, 'The value of new Array(0, 1, 0, 1).length is expected to be 4'); -//CHECK#1 -if (new Array().length !== 0) { - throw new Test262Error('#1: new Array().length === 0. Actual: ' + (new Array().length)); -} - -//CHECK#2 -if (new Array(0, 1, 0, 1).length !== 4) { - throw new Test262Error('#2: new Array(0,1,0,1).length === 4. Actual: ' + (new Array(0, 1, 0, 1).length)); -} - -//CHECK#3 -if (new Array(undefined, undefined).length !== 2) { - throw new Test262Error('#3: new Array(undefined, undefined).length === 2. Actual: ' + (new Array(undefined, undefined).length)); -} +assert.sameValue( + new Array(undefined, undefined).length, + 2, + 'The value of new Array(undefined, undefined).length is expected to be 2' +); diff --git a/test/built-ins/Array/S15.4.2.1_A2.2_T1.js b/test/built-ins/Array/S15.4.2.1_A2.2_T1.js index fa2726f068..3ee4c6f46d 100644 --- a/test/built-ins/Array/S15.4.2.1_A2.2_T1.js +++ b/test/built-ins/Array/S15.4.2.1_A2.2_T1.js @@ -33,6 +33,4 @@ for (var i = 0; i < 100; i++) { } } -if (result !== true) { - throw new Test262Error('#1: x[i] === i. Actual: ' + (x[i])); -} +assert.sameValue(result, true, 'The value of result is expected to be true'); diff --git a/test/built-ins/Array/S15.4.3_A1.1_T1.js b/test/built-ins/Array/S15.4.3_A1.1_T1.js index 79f6d795e9..eacde2d91a 100644 --- a/test/built-ins/Array/S15.4.3_A1.1_T1.js +++ b/test/built-ins/Array/S15.4.3_A1.1_T1.js @@ -13,12 +13,5 @@ description: > Function.prototype.myproperty = 1; -//CHECK#1 -if (Array.myproperty !== 1) { - throw new Test262Error('#1: Function.prototype.myproperty = 1; Array.myproperty === 1. Actual: ' + (Array.myproperty)); -} - -//CHECK#2 -if (Array.hasOwnProperty('myproperty') !== false) { - throw new Test262Error('#2: Function.prototype.myproperty = 1; Array.hasOwnProperty(\'myproperty\') === false. Actual: ' + (Array.hasOwnProperty('myproperty'))); -} +assert.sameValue(Array.myproperty, 1, 'The value of Array.myproperty is expected to be 1'); +assert.sameValue(Array.hasOwnProperty('myproperty'), false, 'Array.hasOwnProperty("myproperty") must return false'); diff --git a/test/built-ins/Array/S15.4.3_A1.1_T2.js b/test/built-ins/Array/S15.4.3_A1.1_T2.js index 8fb6dae81d..3e5dfa605a 100644 --- a/test/built-ins/Array/S15.4.3_A1.1_T2.js +++ b/test/built-ins/Array/S15.4.3_A1.1_T2.js @@ -11,6 +11,9 @@ description: Function.prototype.toString = Object.prototype.toString //CHECK#1 Function.prototype.toString = Object.prototype.toString; -if (Array.toString() !== "[object " + "Function" + "]") { - throw new Test262Error('#1: Function.prototype.toString = Object.prototype.toString; Array.toString() === "[object " + "Function" + "]". Actual: ' + (Array.toString())); -} + +assert.sameValue( + Array.toString(), + "[object Function]", + 'Array.toString() must return "[object Function]"' +); diff --git a/test/built-ins/Array/S15.4.3_A1.1_T3.js b/test/built-ins/Array/S15.4.3_A1.1_T3.js index 03fcf9244d..a51e1001cf 100644 --- a/test/built-ins/Array/S15.4.3_A1.1_T3.js +++ b/test/built-ins/Array/S15.4.3_A1.1_T3.js @@ -8,8 +8,8 @@ info: | es5id: 15.4.3_A1.1_T3 description: Checking use isPrototypeOf ---*/ - -//CHECK#1 -if (Function.prototype.isPrototypeOf(Array) !== true) { - throw new Test262Error('#1: Function.prototype.isPrototypeOf(Array) === true. Actual: ' + (Function.prototype.isPrototypeOf(Array))); -} +assert.sameValue( + Function.prototype.isPrototypeOf(Array), + true, + 'Function.prototype.isPrototypeOf(Array) must return true' +); diff --git a/test/built-ins/Array/S15.4.5.1_A1.2_T2.js b/test/built-ins/Array/S15.4.5.1_A1.2_T2.js index c8c4dd7d57..b0c43932d8 100644 --- a/test/built-ins/Array/S15.4.5.1_A1.2_T2.js +++ b/test/built-ins/Array/S15.4.5.1_A1.2_T2.js @@ -14,12 +14,8 @@ description: Checking an inherited property //CHECK#1 Array.prototype[2] = -1; var x = [0, 1, 2]; -if (x[2] !== 2) { - throw new Test262Error('#1: Array.prototype[2] = -1; x = [0,1,3]; x[2] === 2. Actual: ' + (x[2])); -} +assert.sameValue(x[2], 2, 'The value of x[2] is expected to be 2'); //CHECK#2 x.length = 2; -if (x[2] !== -1) { - throw new Test262Error('#2: Array.prototype[2] = -1; x = [0,1,3]; x.length = 2; x[2] === -1. Actual: ' + (x[2])); -} +assert.sameValue(x[2], -1, 'The value of x[2] is expected to be -1'); diff --git a/test/built-ins/Array/S15.4.5.1_A2.1_T1.js b/test/built-ins/Array/S15.4.5.1_A2.1_T1.js index dd67a6ce22..720470d820 100644 --- a/test/built-ins/Array/S15.4.5.1_A2.1_T1.js +++ b/test/built-ins/Array/S15.4.5.1_A2.1_T1.js @@ -12,32 +12,17 @@ description: P in [4294967295, -1, true] //CHECK#1 var x = []; x[4294967295] = 1; -if (x.length !== 0) { - throw new Test262Error('#1.1: x = []; x[4294967295] = 1; x.length === 0. Actual: ' + (x.length)); -} - -if (x[4294967295] !== 1) { - throw new Test262Error('#1.2: x = []; x[4294967295] = 1; x[4294967295] === 1. Actual: ' + (x[4294967295])); -} +assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0'); +assert.sameValue(x[4294967295], 1, 'The value of x[4294967295] is expected to be 1'); //CHECK#2 x = []; x[-1] = 1; -if (x.length !== 0) { - throw new Test262Error('#2.1: x = []; x[-1] = 1; x.length === 0. Actual: ' + (x.length)); -} - -if (x[-1] !== 1) { - throw new Test262Error('#2.2: x = []; x[-1] = 1; x[-1] === 1. Actual: ' + (x[-1])); -} +assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0'); +assert.sameValue(x[-1], 1, 'The value of x[-1] is expected to be 1'); //CHECK#3 x = []; x[true] = 1; -if (x.length !== 0) { - throw new Test262Error('#3.1: x = []; x[true] = 1; x.length === 0. Actual: ' + (x.length)); -} - -if (x[true] !== 1) { - throw new Test262Error('#3.2: x = []; x[true] = 1; x[true] === 1. Actual: ' + (x[true])); -} +assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0'); +assert.sameValue(x[true], 1, 'The value of x[true] is expected to be 1'); diff --git a/test/built-ins/Array/S15.4.5.1_A2.2_T1.js b/test/built-ins/Array/S15.4.5.1_A2.2_T1.js index d0668db59e..9df4c565e8 100644 --- a/test/built-ins/Array/S15.4.5.1_A2.2_T1.js +++ b/test/built-ins/Array/S15.4.5.1_A2.2_T1.js @@ -12,18 +12,12 @@ description: length === 100, P in [0, 98, 99] //CHECK#1 var x = Array(100); x[0] = 1; -if (x.length !== 100) { - throw new Test262Error('#1: x = Array(100); x[0] = 1; x.length === 100. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 100, 'The value of x.length is expected to be 100'); //CHECK#2 x[98] = 1; -if (x.length !== 100) { - throw new Test262Error('#2: x = Array(100); x[0] = 1; x[98] = 1; x.length === 100. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 100, 'The value of x.length is expected to be 100'); //CHECK#3 x[99] = 1; -if (x.length !== 100) { - throw new Test262Error('#3: x = Array(100); x[0] = 1; x[98] = 1; x[99] = 1; x.length === 100. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 100, 'The value of x.length is expected to be 100'); diff --git a/test/built-ins/Array/S15.4.5.1_A2.3_T1.js b/test/built-ins/Array/S15.4.5.1_A2.3_T1.js index 8a88a56b84..35a69e56de 100644 --- a/test/built-ins/Array/S15.4.5.1_A2.3_T1.js +++ b/test/built-ins/Array/S15.4.5.1_A2.3_T1.js @@ -12,12 +12,8 @@ description: length = 100, P in [100, 199] //CHECK#1 var x = Array(100); x[100] = 1; -if (x.length !== 101) { - throw new Test262Error('#1: x = Array(100); x[100] = 1; x.length === 101. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 101, 'The value of x.length is expected to be 101'); //CHECK#2 x[199] = 1; -if (x.length !== 200) { - throw new Test262Error('#2: x = Array(100); x[100] = 1; x[199] = 1; x.length === 100. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 200, 'The value of x.length is expected to be 200'); diff --git a/test/built-ins/Array/S15.4.5.2_A1_T1.js b/test/built-ins/Array/S15.4.5.2_A1_T1.js index 38611b7729..a8fc10e8bf 100644 --- a/test/built-ins/Array/S15.4.5.2_A1_T1.js +++ b/test/built-ins/Array/S15.4.5.2_A1_T1.js @@ -12,30 +12,20 @@ description: Checking boundary points //CHECK#1 var x = []; -if (x.length !== 0) { - throw new Test262Error('#1: x = []; x.length === 0. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0'); //CHECK#2 x[0] = 1; -if (x.length !== 1) { - throw new Test262Error('#2: x = []; x[1] = 1; x.length === 1. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); //CHECK#3 x[1] = 1; -if (x.length !== 2) { - throw new Test262Error('#3: x = []; x[0] = 1; x[1] = 1; x.length === 2. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2'); //CHECK#4 x[2147483648] = 1; -if (x.length !== 2147483649) { - throw new Test262Error('#4: x = []; x[0] = 1; x[1] = 1; x[2147483648] = 1; x.length === 2147483649. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 2147483649, 'The value of x.length is expected to be 2147483649'); //CHECK#5 x[4294967294] = 1; -if (x.length !== 4294967295) { - throw new Test262Error('#5: x = []; x[0] = 1; x[1] = 1; x[2147483648] = 1; x[42949672954] = 1; x.length === 4294967295. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 4294967295, 'The value of x.length is expected to be 4294967295'); diff --git a/test/built-ins/Array/S15.4.5.2_A1_T2.js b/test/built-ins/Array/S15.4.5.2_A1_T2.js index b558c661ec..0666c2f830 100644 --- a/test/built-ins/Array/S15.4.5.2_A1_T2.js +++ b/test/built-ins/Array/S15.4.5.2_A1_T2.js @@ -13,14 +13,10 @@ description: P = "2^32 - 1" is not index array //CHECK#1 var x = []; x[4294967295] = 1; -if (x.length !== 0) { - throw new Test262Error('#1: x = []; x[4294967295] = 1; x.length === 0. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0'); //CHECK#2 var y = []; y[1] = 1; y[4294967295] = 1; -if (y.length !== 2) { - throw new Test262Error('#2: y = []; y[1] = 1; y[4294967295] = 1; y.length === 2. Actual: ' + (y.length)); -} +assert.sameValue(y.length, 2, 'The value of y.length is expected to be 2'); diff --git a/test/built-ins/Array/S15.4.5.2_A2_T1.js b/test/built-ins/Array/S15.4.5.2_A2_T1.js index 6a8ae1ec57..81c2b7b837 100644 --- a/test/built-ins/Array/S15.4.5.2_A2_T1.js +++ b/test/built-ins/Array/S15.4.5.2_A2_T1.js @@ -11,24 +11,16 @@ description: Checking length property //CHECK#1 var x = []; -if (x.length !== 0) { - throw new Test262Error('#1: x = []; x.length === 0. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0'); //CHECK#2 x[0] = 1; -if (x.length !== 1) { - throw new Test262Error('#2: x = []; x[1] = 1; x.length === 1. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); //CHECK#3 x[1] = 1; -if (x.length !== 2) { - throw new Test262Error('#3: x = []; x[0] = 1; x[1] = 1; x.length === 2. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2'); //CHECK#4 x[9] = 1; -if (x.length !== 10) { - throw new Test262Error('#4: x = []; x[0] = 1; x[1] = 1; x[9] = 1; x.length === 10. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 10, 'The value of x.length is expected to be 10'); diff --git a/test/built-ins/Array/S15.4.5.2_A3_T1.js b/test/built-ins/Array/S15.4.5.2_A3_T1.js index 05988eda66..703c074ba2 100644 --- a/test/built-ins/Array/S15.4.5.2_A3_T1.js +++ b/test/built-ins/Array/S15.4.5.2_A3_T1.js @@ -14,18 +14,10 @@ description: > //CHECK#1 var x = []; x.length = 1; -if (x.length !== 1) { - throw new Test262Error('#1: x = []; x.length = 1; x.length === 1. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); //CHECK#2 x[5] = 1; x.length = 10; -if (x.length !== 10) { - throw new Test262Error('#2: x = []; x.length = 1; x[5] = 1; x.length = 10; x.length === 10. Actual: ' + (x.length)); -} - -//CHECK#3 -if (x[5] !== 1) { - throw new Test262Error('#3: x = []; x.length = 1; x[5] = 1; x.length = 10; x[5] = 1'); -} +assert.sameValue(x.length, 10, 'The value of x.length is expected to be 10'); +assert.sameValue(x[5], 1, 'The value of x[5] is expected to be 1'); diff --git a/test/built-ins/Array/S15.4.5.2_A3_T2.js b/test/built-ins/Array/S15.4.5.2_A3_T2.js index 87312de88e..c71f8abc9c 100644 --- a/test/built-ins/Array/S15.4.5.2_A3_T2.js +++ b/test/built-ins/Array/S15.4.5.2_A3_T2.js @@ -17,34 +17,18 @@ x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; -if (x.length !== 4) { - throw new Test262Error('#1: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length === 4. Actual: ' + (x.length)); -} - -//CHECK#2 -if (x[5] !== undefined) { - throw new Test262Error('#2: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x[5] === undefined. Actual: ' + (x[5])); -} - -//CHECK#3 -if (x[3] !== 3) { - throw new Test262Error('#3: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x[3] === 3. Actual: ' + (x[3])); -} +assert.sameValue(x.length, 4, 'The value of x.length is expected to be 4'); +assert.sameValue(x[5], undefined, 'The value of x[5] is expected to equal undefined'); +assert.sameValue(x[3], 3, 'The value of x[3] is expected to be 3'); //CHECK#4 x.length = new Number(6); -if (x[5] !== undefined) { - throw new Test262Error('#4: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x[5] === undefined. Actual: ' + (x[5])); -} +assert.sameValue(x[5], undefined, 'The value of x[5] is expected to equal undefined'); //CHECK#5 x.length = 0; -if (x[0] !== undefined) { - throw new Test262Error('#5: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x.length = 0; x[0] === undefined. Actual: ' + (x[0])); -} +assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined'); //CHECK#6 x.length = 1; -if (x[1] !== undefined) { - throw new Test262Error('#6: x = []; x[1] = 1; x[3] = 3; x[5] = 5; x.length = 4; x.length = new Number(6); x.length = 0; x.length = 1; x[1] === undefined. Actual: ' + (x[1])); -} +assert.sameValue(x[1], undefined, 'The value of x[1] is expected to equal undefined'); diff --git a/test/built-ins/Array/S15.4.5.2_A3_T3.js b/test/built-ins/Array/S15.4.5.2_A3_T3.js index f7bce716ce..eb7d7ea67c 100644 --- a/test/built-ins/Array/S15.4.5.2_A3_T3.js +++ b/test/built-ins/Array/S15.4.5.2_A3_T3.js @@ -12,9 +12,7 @@ description: "[[Put]] (length, 4294967296)" //CHECK#1 var x = []; x.length = 4294967295; -if (x.length !== 4294967295) { - throw new Test262Error('#1: x = []; x.length = 4294967295; x.length === 4294967295'); -} +assert.sameValue(x.length, 4294967295, 'The value of x.length is expected to be 4294967295'); //CHECK#2 try { @@ -22,7 +20,9 @@ try { x.length = 4294967296; throw new Test262Error('#2.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length)); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#2.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } diff --git a/test/built-ins/Array/S15.4_A1.1_T10.js b/test/built-ins/Array/S15.4_A1.1_T10.js index ac32381804..521828b54b 100644 --- a/test/built-ins/Array/S15.4_A1.1_T10.js +++ b/test/built-ins/Array/S15.4_A1.1_T10.js @@ -20,7 +20,5 @@ for (var i = 0; i < 32; i++) { k = 1; for (i = 0; i < 32; i++) { k = k * 2; - if (x[k - 2] !== k) { - throw new Test262Error('#' + (k - 2) + ': '); - } + assert.sameValue(x[k - 2], k, 'The value of x[k - 2] is expected to equal the value of k'); } diff --git a/test/built-ins/Array/S15.4_A1.1_T4.js b/test/built-ins/Array/S15.4_A1.1_T4.js index d5aa1b1fb2..efa4fe7d2b 100644 --- a/test/built-ins/Array/S15.4_A1.1_T4.js +++ b/test/built-ins/Array/S15.4_A1.1_T4.js @@ -12,13 +12,9 @@ description: Checking for string primitive //CHECK#1 var x = []; x["0"] = 0; -if (x[0] !== 0) { - throw new Test262Error('#1: x = []; x["0"] = 0; x[0] === 0. Actual: ' + (x[0])); -} +assert.sameValue(x[0], 0, 'The value of x[0] is expected to be 0'); //CHECK#2 var y = []; y["1"] = 1; -if (y[1] !== 1) { - throw new Test262Error('#2: y = []; y["1"] = 1; y[1] === 1. Actual: ' + (y[1])); -} +assert.sameValue(y[1], 1, 'The value of y[1] is expected to be 1'); diff --git a/test/built-ins/Array/S15.4_A1.1_T5.js b/test/built-ins/Array/S15.4_A1.1_T5.js index e5c2961fce..73ca7f35f6 100644 --- a/test/built-ins/Array/S15.4_A1.1_T5.js +++ b/test/built-ins/Array/S15.4_A1.1_T5.js @@ -12,23 +12,11 @@ description: Checking for null and undefined //CHECK#1 var x = []; x[null] = 0; -if (x[0] !== undefined) { - throw new Test262Error('#1: x = []; x[null] = 1; x[0] === undefined. Actual: ' + (x[0])); -} - -//CHECK#2 -if (x["null"] !== 0) { - throw new Test262Error('#2: x = []; x[null] = 1; x["null"] === 0. Actual: ' + (x["null"])); -} +assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined'); +assert.sameValue(x["null"], 0, 'The value of x["null"] is expected to be 0'); //CHECK#3 var y = []; y[undefined] = 0; -if (y[0] !== undefined) { - throw new Test262Error('#3: y = []; y[undefined] = 0; y[0] === undefined. Actual: ' + (y[0])); -} - -//CHECK#4 -if (y["undefined"] !== 0) { - throw new Test262Error('#4: y = []; y[undefined] = 1; y["undefined"] === 0. Actual: ' + (y["undefined"])); -} +assert.sameValue(y[0], undefined, 'The value of y[0] is expected to equal undefined'); +assert.sameValue(y["undefined"], 0, 'The value of y["undefined"] is expected to be 0'); diff --git a/test/built-ins/Array/S15.4_A1.1_T6.js b/test/built-ins/Array/S15.4_A1.1_T6.js index 009cc79727..0c6facf162 100644 --- a/test/built-ins/Array/S15.4_A1.1_T6.js +++ b/test/built-ins/Array/S15.4_A1.1_T6.js @@ -12,22 +12,10 @@ description: Checking for Boolean object //CHECK#1 var x = []; x[new Boolean(true)] = 1; -if (x[1] !== undefined) { - throw new Test262Error('#1: x = []; x[new Boolean(true)] = 1; x[1] === undefined. Actual: ' + (x[1])); -} - -//CHECK#2 -if (x["true"] !== 1) { - throw new Test262Error('#2: x = []; x[true] = 1; x["true"] === 1. Actual: ' + (x["true"])); -} +assert.sameValue(x[1], undefined, 'The value of x[1] is expected to equal undefined'); +assert.sameValue(x["true"], 1, 'The value of x["true"] is expected to be 1'); //CHECK#3 x[new Boolean(false)] = 0; -if (x[0] !== undefined) { - throw new Test262Error('#3: x = []; x[true] = 1; x[new Boolean(false)] = 0; x[0] === undefined. Actual: ' + (x[0])); -} - -//CHECK#4 -if (x["false"] !== 0) { - throw new Test262Error('#4: x = []; x[false] = 1; x["false"] === 0. Actual: ' + (x["false"])); -} +assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined'); +assert.sameValue(x["false"], 0, 'The value of x["false"] is expected to be 0'); diff --git a/test/built-ins/Array/S15.4_A1.1_T7.js b/test/built-ins/Array/S15.4_A1.1_T7.js index 1732a5912f..011a5deeb9 100644 --- a/test/built-ins/Array/S15.4_A1.1_T7.js +++ b/test/built-ins/Array/S15.4_A1.1_T7.js @@ -12,20 +12,14 @@ description: Checking for Number object //CHECK#1 var x = []; x[new Number(0)] = 0; -if (x[0] !== 0) { - throw new Test262Error('#1: x = []; x[new Number(0)] = 0; x[0] === 0. Actual: ' + (x[0])); -} +assert.sameValue(x[0], 0, 'The value of x[0] is expected to be 0'); //CHECK#2 var y = []; y[new Number(1)] = 1; -if (y[1] !== 1) { - throw new Test262Error('#2: y = []; y[new Number(1)] = 1; y[1] === 1. Actual: ' + (y[1])); -} +assert.sameValue(y[1], 1, 'The value of y[1] is expected to be 1'); //CHECK#3 var z = []; z[new Number(1.1)] = 1; -if (z["1.1"] !== 1) { - throw new Test262Error('#3: z = []; z[new Number(1.1)] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"])); -} +assert.sameValue(z["1.1"], 1, 'The value of z["1.1"] is expected to be 1'); diff --git a/test/built-ins/Array/S15.4_A1.1_T8.js b/test/built-ins/Array/S15.4_A1.1_T8.js index c8f2ccb716..927ba0e72d 100644 --- a/test/built-ins/Array/S15.4_A1.1_T8.js +++ b/test/built-ins/Array/S15.4_A1.1_T8.js @@ -12,20 +12,14 @@ description: Checking for Number object //CHECK#1 var x = []; x[new String("0")] = 0; -if (x[0] !== 0) { - throw new Test262Error('#1: x = []; x[new String("0")] = 0; x[0] === 0. Actual: ' + (x[0])); -} +assert.sameValue(x[0], 0, 'The value of x[0] is expected to be 0'); //CHECK#2 var y = []; y[new String("1")] = 1; -if (y[1] !== 1) { - throw new Test262Error('#2: y = []; y[new String("1")] = 1; y[1] === 1. Actual: ' + (y[1])); -} +assert.sameValue(y[1], 1, 'The value of y[1] is expected to be 1'); //CHECK#3 var z = []; z[new String("1.1")] = 1; -if (z["1.1"] !== 1) { - throw new Test262Error('#3: z = []; z[new String("1.1")] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"])); -} +assert.sameValue(z["1.1"], 1, 'The value of z["1.1"] is expected to be 1'); diff --git a/test/built-ins/Array/S15.4_A1.1_T9.js b/test/built-ins/Array/S15.4_A1.1_T9.js index 1e62315a20..ed65434240 100644 --- a/test/built-ins/Array/S15.4_A1.1_T9.js +++ b/test/built-ins/Array/S15.4_A1.1_T9.js @@ -17,9 +17,7 @@ var object = { } }; x[object] = 0; -if (x["[object Object]"] !== 0) { - throw new Test262Error('#1: x = []; var object = {valueOf: function() {return 1}}; x[object] = 0; x["[object Object]"] === 0. Actual: ' + (x["[object Object]"])); -} +assert.sameValue(x["[object Object]"], 0, 'The value of x["[object Object]"] is expected to be 0'); //CHECK#2 x = []; @@ -32,9 +30,7 @@ var object = { } }; x[object] = 0; -if (x[0] !== 0) { - throw new Test262Error('#2: x = []; var object = {valueOf: function() {return 1}, toString: function() {return 0}}; x[object] = 0; x[0] === 0. Actual: ' + (x[0])); -} +assert.sameValue(x[0], 0, 'The value of x[0] is expected to be 0'); //CHECK#3 x = []; @@ -47,9 +43,7 @@ var object = { } }; x[object] = 0; -if (x[1] !== 0) { - throw new Test262Error('#3: x = []; var object = {valueOf: function() {return 1}, toString: function() {return {}}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1])); -} +assert.sameValue(x[1], 0, 'The value of x[1] is expected to be 0'); //CHECK#4 try { @@ -63,16 +57,10 @@ try { } }; x[object] = 0; - if (x[1] !== 0) { - throw new Test262Error('#4.1: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + (x[1])); - } + assert.sameValue(x[1], 0, 'The value of x[1] is expected to be 0'); } catch (e) { - if (e === "error") { - throw new Test262Error('#4.2: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + ("error")); - } else { - throw new Test262Error('#4.3: x = []; var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x[object] = 0; x[1] === 1. Actual: ' + (e)); - } + assert.notSameValue(e, "error", 'The value of e is not "error"'); } //CHECK#5 @@ -83,9 +71,7 @@ var object = { } }; x[object] = 0; -if (x[1] !== 0) { - throw new Test262Error('#5: x = []; var object = {toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1])); -} +assert.sameValue(x[1], 0, 'The value of x[1] is expected to be 0'); //CHECK#6 x = []; @@ -98,9 +84,7 @@ var object = { } } x[object] = 0; -if (x[1] !== 0) { - throw new Test262Error('#6: x = []; var object = {valueOf: function() {return {}}, toString: function() {return 1}}; x[object] = 0; x[1] === 0. Actual: ' + (x[1])); -} +assert.sameValue(x[1], 0, 'The value of x[1] is expected to be 0'); //CHECK#7 try { @@ -117,9 +101,7 @@ try { throw new Test262Error('#7.1: x = []; var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; x[object] throw "error". Actual: ' + (x[object])); } catch (e) { - if (e !== "error") { - throw new Test262Error('#7.2: x = []; var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; x[object] throw "error". Actual: ' + (e)); - } + assert.sameValue(e, "error", 'The value of e is expected to be "error"'); } //CHECK#8 @@ -137,7 +119,9 @@ try { throw new Test262Error('#8.1: x = []; var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x[object] throw TypeError. Actual: ' + (x[object])); } catch (e) { - if ((e instanceof TypeError) !== true) { - throw new Test262Error('#8.2: x = []; var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x[object] throw TypeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof TypeError, + true, + 'The result of evaluating (e instanceof TypeError) is expected to be true' + ); } diff --git a/test/built-ins/Array/constructor.js b/test/built-ins/Array/constructor.js index 5ee0bd0201..e9d3222b7b 100644 --- a/test/built-ins/Array/constructor.js +++ b/test/built-ins/Array/constructor.js @@ -7,4 +7,4 @@ description: > The Array constructor is a built-in function ---*/ -assert.sameValue(typeof Array, 'function'); +assert.sameValue(typeof Array, 'function', 'The value of `typeof Array` is expected to be "function"'); diff --git a/test/built-ins/Array/from/Array.from-name.js b/test/built-ins/Array/from/Array.from-name.js index ff6f4913af..75795bd73d 100644 --- a/test/built-ins/Array/from/Array.from-name.js +++ b/test/built-ins/Array/from/Array.from-name.js @@ -22,7 +22,7 @@ includes: [propertyHelper.js] assert.sameValue( Array.from.name, 'from', - 'The value of `Array.from.name` is `"from"`' + 'The value of Array.from.name is expected to be "from"' ); verifyNotEnumerable(Array.from, 'name'); diff --git a/test/built-ins/Array/from/Array.from_arity.js b/test/built-ins/Array/from/Array.from_arity.js index 88eb713f0e..2aa04a0ebd 100644 --- a/test/built-ins/Array/from/Array.from_arity.js +++ b/test/built-ins/Array/from/Array.from_arity.js @@ -14,7 +14,7 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.from.length, 1); +assert.sameValue(Array.from.length, 1, 'The value of Array.from.length is expected to be 1'); verifyNotEnumerable(Array.from, 'length'); verifyNotWritable(Array.from, 'length'); diff --git a/test/built-ins/Array/from/Array.from_forwards-length-for-array-likes.js b/test/built-ins/Array/from/Array.from_forwards-length-for-array-likes.js index 382d6fab0f..ec5bf2063e 100644 --- a/test/built-ins/Array/from/Array.from_forwards-length-for-array-likes.js +++ b/test/built-ins/Array/from/Array.from_forwards-length-for-array-likes.js @@ -31,6 +31,9 @@ result = Array.from.call(MyCollection, { length: 42 }); -assert.sameValue(result.args.length, 1); -assert.sameValue(result.args[0], 42); -assert(result instanceof MyCollection); +assert.sameValue(result.args.length, 1, 'The value of result.args.length is expected to be 1'); +assert.sameValue(result.args[0], 42, 'The value of result.args[0] is expected to be 42'); +assert( + result instanceof MyCollection, + 'The result of evaluating (result instanceof MyCollection) is expected to be true' +); diff --git a/test/built-ins/Array/from/calling-from-valid-1-noStrict.js b/test/built-ins/Array/from/calling-from-valid-1-noStrict.js index 72d7139765..35dc3e0ed4 100644 --- a/test/built-ins/Array/from/calling-from-valid-1-noStrict.js +++ b/test/built-ins/Array/from/calling-from-valid-1-noStrict.js @@ -43,24 +43,24 @@ function mapFn(value) { var result = Array.from(list, mapFn); -assert.sameValue(result.length, 3, 'result.length'); -assert.sameValue(result[0], 82, 'result[0]'); -assert.sameValue(result[1], 84, 'result[1]'); -assert.sameValue(result[2], 86, 'result[2]'); +assert.sameValue(result.length, 3, 'The value of result.length is expected to be 3'); +assert.sameValue(result[0], 82, 'The value of result[0] is expected to be 82'); +assert.sameValue(result[1], 84, 'The value of result[1] is expected to be 84'); +assert.sameValue(result[2], 86, 'The value of result[2] is expected to be 86'); -assert.sameValue(calls.length, 3, 'calls.length'); +assert.sameValue(calls.length, 3, 'The value of calls.length is expected to be 3'); -assert.sameValue(calls[0].args.length, 2, 'calls[0].args.length'); -assert.sameValue(calls[0].args[0], 41, 'calls[0].args[0]'); -assert.sameValue(calls[0].args[1], 0, 'calls[0].args[1]'); -assert.sameValue(calls[0].thisArg, this, 'calls[0].thisArg'); +assert.sameValue(calls[0].args.length, 2, 'The value of calls[0].args.length is expected to be 2'); +assert.sameValue(calls[0].args[0], 41, 'The value of calls[0].args[0] is expected to be 41'); +assert.sameValue(calls[0].args[1], 0, 'The value of calls[0].args[1] is expected to be 0'); +assert.sameValue(calls[0].thisArg, this, 'The value of calls[0].thisArg is expected to be this'); -assert.sameValue(calls[1].args.length, 2, 'calls[1].args.length'); -assert.sameValue(calls[1].args[0], 42, 'calls[1].args[0]'); -assert.sameValue(calls[1].args[1], 1, 'calls[1].args[1]'); -assert.sameValue(calls[1].thisArg, this, 'calls[1].thisArg'); +assert.sameValue(calls[1].args.length, 2, 'The value of calls[1].args.length is expected to be 2'); +assert.sameValue(calls[1].args[0], 42, 'The value of calls[1].args[0] is expected to be 42'); +assert.sameValue(calls[1].args[1], 1, 'The value of calls[1].args[1] is expected to be 1'); +assert.sameValue(calls[1].thisArg, this, 'The value of calls[1].thisArg is expected to be this'); -assert.sameValue(calls[2].args.length, 2, 'calls[2].args.length'); -assert.sameValue(calls[2].args[0], 43, 'calls[2].args[0]'); -assert.sameValue(calls[2].args[1], 2, 'calls[2].args[1]'); -assert.sameValue(calls[2].thisArg, this, 'calls[2].thisArg'); +assert.sameValue(calls[2].args.length, 2, 'The value of calls[2].args.length is expected to be 2'); +assert.sameValue(calls[2].args[0], 43, 'The value of calls[2].args[0] is expected to be 43'); +assert.sameValue(calls[2].args[1], 2, 'The value of calls[2].args[1] is expected to be 2'); +assert.sameValue(calls[2].thisArg, this, 'The value of calls[2].thisArg is expected to be this'); diff --git a/test/built-ins/Array/from/calling-from-valid-1-onlyStrict.js b/test/built-ins/Array/from/calling-from-valid-1-onlyStrict.js index 68141450db..d7763285a9 100644 --- a/test/built-ins/Array/from/calling-from-valid-1-onlyStrict.js +++ b/test/built-ins/Array/from/calling-from-valid-1-onlyStrict.js @@ -43,24 +43,24 @@ function mapFn(value) { var result = Array.from(list, mapFn); -assert.sameValue(result.length, 3, 'result.length'); -assert.sameValue(result[0], 82, 'result[0]'); -assert.sameValue(result[1], 84, 'result[1]'); -assert.sameValue(result[2], 86, 'result[2]'); +assert.sameValue(result.length, 3, 'The value of result.length is expected to be 3'); +assert.sameValue(result[0], 82, 'The value of result[0] is expected to be 82'); +assert.sameValue(result[1], 84, 'The value of result[1] is expected to be 84'); +assert.sameValue(result[2], 86, 'The value of result[2] is expected to be 86'); -assert.sameValue(calls.length, 3, 'calls.length'); +assert.sameValue(calls.length, 3, 'The value of calls.length is expected to be 3'); -assert.sameValue(calls[0].args.length, 2, 'calls[0].args.length'); -assert.sameValue(calls[0].args[0], 41, 'calls[0].args[0]'); -assert.sameValue(calls[0].args[1], 0, 'calls[0].args[1]'); -assert.sameValue(calls[0].thisArg, undefined, 'calls[0].thisArg'); +assert.sameValue(calls[0].args.length, 2, 'The value of calls[0].args.length is expected to be 2'); +assert.sameValue(calls[0].args[0], 41, 'The value of calls[0].args[0] is expected to be 41'); +assert.sameValue(calls[0].args[1], 0, 'The value of calls[0].args[1] is expected to be 0'); +assert.sameValue(calls[0].thisArg, undefined, 'The value of calls[0].thisArg is expected to equal undefined'); -assert.sameValue(calls[1].args.length, 2, 'calls[1].args.length'); -assert.sameValue(calls[1].args[0], 42, 'calls[1].args[0]'); -assert.sameValue(calls[1].args[1], 1, 'calls[1].args[1]'); -assert.sameValue(calls[1].thisArg, undefined, 'calls[1].thisArg'); +assert.sameValue(calls[1].args.length, 2, 'The value of calls[1].args.length is expected to be 2'); +assert.sameValue(calls[1].args[0], 42, 'The value of calls[1].args[0] is expected to be 42'); +assert.sameValue(calls[1].args[1], 1, 'The value of calls[1].args[1] is expected to be 1'); +assert.sameValue(calls[1].thisArg, undefined, 'The value of calls[1].thisArg is expected to equal undefined'); -assert.sameValue(calls[2].args.length, 2, 'calls[2].args.length'); -assert.sameValue(calls[2].args[0], 43, 'calls[2].args[0]'); -assert.sameValue(calls[2].args[1], 2, 'calls[2].args[1]'); -assert.sameValue(calls[2].thisArg, undefined, 'calls[2].thisArg'); +assert.sameValue(calls[2].args.length, 2, 'The value of calls[2].args.length is expected to be 2'); +assert.sameValue(calls[2].args[0], 43, 'The value of calls[2].args[0] is expected to be 43'); +assert.sameValue(calls[2].args[1], 2, 'The value of calls[2].args[1] is expected to be 2'); +assert.sameValue(calls[2].thisArg, undefined, 'The value of calls[2].thisArg is expected to equal undefined'); diff --git a/test/built-ins/Array/from/calling-from-valid-2.js b/test/built-ins/Array/from/calling-from-valid-2.js index 2bdfd0d639..5e0d6026e9 100644 --- a/test/built-ins/Array/from/calling-from-valid-2.js +++ b/test/built-ins/Array/from/calling-from-valid-2.js @@ -44,24 +44,24 @@ function mapFn(value) { var result = Array.from(list, mapFn, thisArg); -assert.sameValue(result.length, 3, 'result.length'); -assert.sameValue(result[0], 82, 'result[0]'); -assert.sameValue(result[1], 84, 'result[1]'); -assert.sameValue(result[2], 86, 'result[2]'); +assert.sameValue(result.length, 3, 'The value of result.length is expected to be 3'); +assert.sameValue(result[0], 82, 'The value of result[0] is expected to be 82'); +assert.sameValue(result[1], 84, 'The value of result[1] is expected to be 84'); +assert.sameValue(result[2], 86, 'The value of result[2] is expected to be 86'); -assert.sameValue(calls.length, 3, 'calls.length'); +assert.sameValue(calls.length, 3, 'The value of calls.length is expected to be 3'); -assert.sameValue(calls[0].args.length, 2, 'calls[0].args.length'); -assert.sameValue(calls[0].args[0], 41, 'calls[0].args[0]'); -assert.sameValue(calls[0].args[1], 0, 'calls[0].args[1]'); -assert.sameValue(calls[0].thisArg, thisArg, 'calls[0].thisArg'); +assert.sameValue(calls[0].args.length, 2, 'The value of calls[0].args.length is expected to be 2'); +assert.sameValue(calls[0].args[0], 41, 'The value of calls[0].args[0] is expected to be 41'); +assert.sameValue(calls[0].args[1], 0, 'The value of calls[0].args[1] is expected to be 0'); +assert.sameValue(calls[0].thisArg, thisArg, 'The value of calls[0].thisArg is expected to equal the value of thisArg'); -assert.sameValue(calls[1].args.length, 2, 'calls[1].args.length'); -assert.sameValue(calls[1].args[0], 42, 'calls[1].args[0]'); -assert.sameValue(calls[1].args[1], 1, 'calls[1].args[1]'); -assert.sameValue(calls[1].thisArg, thisArg, 'calls[1].thisArg'); +assert.sameValue(calls[1].args.length, 2, 'The value of calls[1].args.length is expected to be 2'); +assert.sameValue(calls[1].args[0], 42, 'The value of calls[1].args[0] is expected to be 42'); +assert.sameValue(calls[1].args[1], 1, 'The value of calls[1].args[1] is expected to be 1'); +assert.sameValue(calls[1].thisArg, thisArg, 'The value of calls[1].thisArg is expected to equal the value of thisArg'); -assert.sameValue(calls[2].args.length, 2, 'calls[2].args.length'); -assert.sameValue(calls[2].args[0], 43, 'calls[2].args[0]'); -assert.sameValue(calls[2].args[1], 2, 'calls[2].args[1]'); -assert.sameValue(calls[2].thisArg, thisArg, 'calls[2].thisArg'); +assert.sameValue(calls[2].args.length, 2, 'The value of calls[2].args.length is expected to be 2'); +assert.sameValue(calls[2].args[0], 43, 'The value of calls[2].args[0] is expected to be 43'); +assert.sameValue(calls[2].args[1], 2, 'The value of calls[2].args[1] is expected to be 2'); +assert.sameValue(calls[2].thisArg, thisArg, 'The value of calls[2].thisArg is expected to equal the value of thisArg'); diff --git a/test/built-ins/Array/from/elements-added-after.js b/test/built-ins/Array/from/elements-added-after.js index 52900144f5..f6b53d15fa 100644 --- a/test/built-ins/Array/from/elements-added-after.js +++ b/test/built-ins/Array/from/elements-added-after.js @@ -22,8 +22,8 @@ var array = [2, 4, 8, 16, 32, 64, 128]; function mapFn(value, index) { arrayIndex++; - assert.sameValue(value, obj[arrayIndex], "Value mismatch in mapFn at index " + index + "."); - assert.sameValue(index, arrayIndex, "Index mismatch in mapFn."); + assert.sameValue(value, obj[arrayIndex], 'The value of value is expected to equal the value of obj[arrayIndex]'); + assert.sameValue(index, arrayIndex, 'The value of index is expected to equal the value of arrayIndex'); obj[originalLength + arrayIndex] = 2 * arrayIndex + 1; return obj[arrayIndex]; @@ -31,8 +31,8 @@ function mapFn(value, index) { var a = Array.from(obj, mapFn); -assert.sameValue(a.length, array.length, "Length mismatch."); +assert.sameValue(a.length, array.length, 'The value of a.length is expected to equal the value of array.length'); for (var j = 0; j < a.length; j++) { - assert.sameValue(a[j], array[j], "Element mismatch for array at index " + j + "."); + assert.sameValue(a[j], array[j], 'The value of a[j] is expected to equal the value of array[j]'); } diff --git a/test/built-ins/Array/from/elements-deleted-after.js b/test/built-ins/Array/from/elements-deleted-after.js index bb040550c2..5ee75cbd60 100644 --- a/test/built-ins/Array/from/elements-deleted-after.js +++ b/test/built-ins/Array/from/elements-deleted-after.js @@ -15,8 +15,8 @@ var arrayIndex = -1; function mapFn(value, index) { this.arrayIndex++; - assert.sameValue(value, array[this.arrayIndex], "Value mismatch in mapFn at index " + index + "."); - assert.sameValue(index, this.arrayIndex, "Index mismatch in mapFn."); + assert.sameValue(value, array[this.arrayIndex], 'The value of value is expected to equal the value of array[this.arrayIndex]'); + assert.sameValue(index, this.arrayIndex, 'The value of index is expected to equal the value of this.arrayIndex'); array.splice(array.length - 1, 1); return 127; @@ -25,8 +25,8 @@ function mapFn(value, index) { a = Array.from(array, mapFn, this); -assert.sameValue(a.length, originalArray.length / 2, "Length mismatch. Old array : " + (originalArray.length / 2) + ". array : " + a.length + "."); +assert.sameValue(a.length, originalArray.length / 2, 'The value of a.length is expected to be originalArray.length / 2'); for (var j = 0; j < originalArray.length / 2; j++) { - assert.sameValue(a[j], 127, "Element mismatch for mapped array at index " + j + "."); + assert.sameValue(a[j], 127, 'The value of a[j] is expected to be 127'); } diff --git a/test/built-ins/Array/from/elements-updated-after.js b/test/built-ins/Array/from/elements-updated-after.js index 96a9260aba..b547a21b0f 100644 --- a/test/built-ins/Array/from/elements-updated-after.js +++ b/test/built-ins/Array/from/elements-updated-after.js @@ -14,14 +14,14 @@ function mapFn(value, index) { if (index + 1 < array.length) { array[index + 1] = 127; } - assert.sameValue(value, 127, "Value mismatch in mapFn at index " + index + "."); - assert.sameValue(index, arrayIndex, "Index mismatch in mapFn."); + assert.sameValue(value, 127, 'The value of value is expected to be 127'); + assert.sameValue(index, arrayIndex, 'The value of index is expected to equal the value of arrayIndex'); return value; } var a = Array.from(array, mapFn); -assert.sameValue(a.length, array.length, "Length mismatch."); +assert.sameValue(a.length, array.length, 'The value of a.length is expected to equal the value of array.length'); for (var j = 0; j < a.length; j++) { - assert.sameValue(a[j], 127, "Element mismatch for mapped array."); + assert.sameValue(a[j], 127, 'The value of a[j] is expected to be 127'); } diff --git a/test/built-ins/Array/from/from-array.js b/test/built-ins/Array/from/from-array.js index ab77bd9460..51e0b6064c 100644 --- a/test/built-ins/Array/from/from-array.js +++ b/test/built-ins/Array/from/from-array.js @@ -9,15 +9,15 @@ esid: sec-array.from var array = [0, 'foo', , Infinity]; var result = Array.from(array); -assert.sameValue(result.length, 4, 'result.length'); -assert.sameValue(result[0], 0, 'result[0]'); -assert.sameValue(result[1], 'foo', 'result[1]'); -assert.sameValue(result[2], undefined, 'result[2]'); -assert.sameValue(result[3], Infinity, 'result[3]'); +assert.sameValue(result.length, 4, 'The value of result.length is expected to be 4'); +assert.sameValue(result[0], 0, 'The value of result[0] is expected to be 0'); +assert.sameValue(result[1], 'foo', 'The value of result[1] is expected to be "foo"'); +assert.sameValue(result[2], undefined, 'The value of result[2] is expected to equal undefined'); +assert.sameValue(result[3], Infinity, 'The value of result[3] is expected to equal Infinity'); assert.notSameValue( result, array, - 'result is not the object from items argument' + 'The value of result is expected to not equal the value of `array`' ); -assert(result instanceof Array, 'result instanceof Array'); +assert(result instanceof Array, 'The result of evaluating (result instanceof Array) is expected to be true'); diff --git a/test/built-ins/Array/from/from-string.js b/test/built-ins/Array/from/from-string.js index c4df63f35b..fcb5068378 100644 --- a/test/built-ins/Array/from/from-string.js +++ b/test/built-ins/Array/from/from-string.js @@ -10,8 +10,8 @@ author: Hank Yates (hankyates@gmail.com) var arrLikeSource = 'Test'; var result = Array.from(arrLikeSource); -assert.sameValue(result.length, 4, 'result.length'); -assert.sameValue(result[0], 'T', 'result[0]'); -assert.sameValue(result[1], 'e', 'result[1]'); -assert.sameValue(result[2], 's', 'result[2]'); -assert.sameValue(result[3], 't', 'result[3]'); +assert.sameValue(result.length, 4, 'The value of result.length is expected to be 4'); +assert.sameValue(result[0], 'T', 'The value of result[0] is expected to be "T"'); +assert.sameValue(result[1], 'e', 'The value of result[1] is expected to be "e"'); +assert.sameValue(result[2], 's', 'The value of result[2] is expected to be "s"'); +assert.sameValue(result[3], 't', 'The value of result[3] is expected to be "t"'); diff --git a/test/built-ins/Array/from/get-iter-method-err.js b/test/built-ins/Array/from/get-iter-method-err.js index ad775b6973..321287e33a 100644 --- a/test/built-ins/Array/from/get-iter-method-err.js +++ b/test/built-ins/Array/from/get-iter-method-err.js @@ -19,4 +19,4 @@ Object.defineProperty(items, Symbol.iterator, { assert.throws(Test262Error, function() { Array.from(items); -}); +}, 'Array.from(items) throws a Test262Error exception'); diff --git a/test/built-ins/Array/from/items-is-arraybuffer.js b/test/built-ins/Array/from/items-is-arraybuffer.js index d936efe736..60c2c6e008 100644 --- a/test/built-ins/Array/from/items-is-arraybuffer.js +++ b/test/built-ins/Array/from/items-is-arraybuffer.js @@ -16,4 +16,4 @@ var arrayBuffer = new ArrayBuffer(7); var result = Array.from(arrayBuffer); -assert.sameValue(result.length, 0); +assert.sameValue(result.length, 0, 'The value of result.length is expected to be 0'); diff --git a/test/built-ins/Array/from/items-is-null-throws.js b/test/built-ins/Array/from/items-is-null-throws.js index ca5fa8b3db..a6ada76d01 100644 --- a/test/built-ins/Array/from/items-is-null-throws.js +++ b/test/built-ins/Array/from/items-is-null-throws.js @@ -14,4 +14,4 @@ info: | assert.throws(TypeError, function() { Array.from(null); -}); +}, 'Array.from(null) throws a TypeError exception'); diff --git a/test/built-ins/Array/from/iter-adv-err.js b/test/built-ins/Array/from/iter-adv-err.js index 38b6181fcd..34cc1174e2 100644 --- a/test/built-ins/Array/from/iter-adv-err.js +++ b/test/built-ins/Array/from/iter-adv-err.js @@ -25,4 +25,4 @@ items[Symbol.iterator] = function() { assert.throws(Test262Error, function() { Array.from(items); -}); +}, 'Array.from(items) throws a Test262Error exception'); diff --git a/test/built-ins/Array/from/iter-cstm-ctor-err.js b/test/built-ins/Array/from/iter-cstm-ctor-err.js index ff33ed6246..4f29fb4f46 100644 --- a/test/built-ins/Array/from/iter-cstm-ctor-err.js +++ b/test/built-ins/Array/from/iter-cstm-ctor-err.js @@ -23,4 +23,4 @@ items[Symbol.iterator] = function() {}; assert.throws(Test262Error, function() { Array.from.call(C, items); -}); +}, 'Array.from.call(C, items) throws a Test262Error exception'); diff --git a/test/built-ins/Array/from/iter-cstm-ctor.js b/test/built-ins/Array/from/iter-cstm-ctor.js index e73e60a02c..f5eebd8d23 100644 --- a/test/built-ins/Array/from/iter-cstm-ctor.js +++ b/test/built-ins/Array/from/iter-cstm-ctor.js @@ -36,13 +36,13 @@ items[Symbol.iterator] = function() { result = Array.from.call(C, items); assert( - result instanceof C, 'Constructed value is an instance of the constructor' + result instanceof C, 'The result of evaluating (result instanceof C) is expected to be true' ); assert.sameValue( result.constructor, C, - 'Constructed value correctly defines a `constructor` property' + 'The value of result.constructor is expected to equal the value of C' ); -assert.sameValue(callCount, 1, 'Constructor invoked exactly once'); -assert.sameValue(thisVal, result, 'Constructed value is returned'); -assert.sameValue(args.length, 0, 'Constructor invoked without arguments'); +assert.sameValue(callCount, 1, 'The value of callCount is expected to be 1'); +assert.sameValue(thisVal, result, 'The value of thisVal is expected to equal the value of result'); +assert.sameValue(args.length, 0, 'The value of args.length is expected to be 0'); diff --git a/test/built-ins/Array/from/iter-get-iter-err.js b/test/built-ins/Array/from/iter-get-iter-err.js index 2beb85e6db..77dc209833 100644 --- a/test/built-ins/Array/from/iter-get-iter-err.js +++ b/test/built-ins/Array/from/iter-get-iter-err.js @@ -12,11 +12,11 @@ info: | features: [Symbol.iterator] ---*/ -var items = {}; -items[Symbol.iterator] = function() { +var itemsPoisonedSymbolIterator = {}; +itemsPoisonedSymbolIterator[Symbol.iterator] = function() { throw new Test262Error(); }; assert.throws(Test262Error, function() { - Array.from(items); -}); + Array.from(itemsPoisonedSymbolIterator); +}, 'Array.from(itemsPoisonedSymbolIterator) throws a Test262Error exception'); diff --git a/test/built-ins/Array/from/iter-get-iter-val-err.js b/test/built-ins/Array/from/iter-get-iter-val-err.js index 896c671dfd..8f1c1f5143 100644 --- a/test/built-ins/Array/from/iter-get-iter-val-err.js +++ b/test/built-ins/Array/from/iter-get-iter-val-err.js @@ -14,14 +14,14 @@ info: | features: [Symbol.iterator] ---*/ -var items = {}; +var itemsPoisonedIteratorValue = {}; var poisonedValue = {}; Object.defineProperty(poisonedValue, 'value', { get: function() { throw new Test262Error(); } }); -items[Symbol.iterator] = function() { +itemsPoisonedIteratorValue[Symbol.iterator] = function() { return { next: function() { return poisonedValue; @@ -30,5 +30,5 @@ items[Symbol.iterator] = function() { }; assert.throws(Test262Error, function() { - Array.from(items); -}); + Array.from(itemsPoisonedIteratorValue); +}, 'Array.from(itemsPoisonedIteratorValue) throws a Test262Error exception'); diff --git a/test/built-ins/Array/from/iter-map-fn-args.js b/test/built-ins/Array/from/iter-map-fn-args.js index ffba396935..dddb4b790a 100644 --- a/test/built-ins/Array/from/iter-map-fn-args.js +++ b/test/built-ins/Array/from/iter-map-fn-args.js @@ -56,16 +56,16 @@ items[Symbol.iterator] = function() { Array.from(items, mapFn); -assert.sameValue(args.length, 2, 'Iteration count'); +assert.sameValue(args.length, 2, 'The value of args.length is expected to be 2'); -assert.sameValue(args[0].length, 2, 'First iteration: arguments length'); +assert.sameValue(args[0].length, 2, 'The value of args[0].length is expected to be 2'); assert.sameValue( - args[0][0], firstResult.value, 'First iteration: first argument' + args[0][0], firstResult.value, 'The value of args[0][0] is expected to equal the value of firstResult.value' ); -assert.sameValue(args[0][1], 0, 'First iteration: second argument'); +assert.sameValue(args[0][1], 0, 'The value of args[0][1] is expected to be 0'); -assert.sameValue(args[1].length, 2, 'Second iteration: arguments length'); +assert.sameValue(args[1].length, 2, 'The value of args[1].length is expected to be 2'); assert.sameValue( - args[1][0], secondResult.value, 'Second iteration: first argument' + args[1][0], secondResult.value, 'The value of args[1][0] is expected to equal the value of secondResult.value' ); -assert.sameValue(args[1][1], 1, 'Second iteration: second argument'); +assert.sameValue(args[1][1], 1, 'The value of args[1][1] is expected to be 1'); diff --git a/test/built-ins/Array/from/iter-map-fn-err.js b/test/built-ins/Array/from/iter-map-fn-err.js index 58ba309362..0f589abf01 100644 --- a/test/built-ins/Array/from/iter-map-fn-err.js +++ b/test/built-ins/Array/from/iter-map-fn-err.js @@ -36,6 +36,6 @@ items[Symbol.iterator] = function() { assert.throws(Test262Error, function() { Array.from(items, mapFn); -}); +}, 'Array.from(items, mapFn) throws a Test262Error exception'); -assert.sameValue(closeCount, 1); +assert.sameValue(closeCount, 1, 'The value of closeCount is expected to be 1'); diff --git a/test/built-ins/Array/from/iter-map-fn-return.js b/test/built-ins/Array/from/iter-map-fn-return.js index 26f70ed51f..70667d487a 100644 --- a/test/built-ins/Array/from/iter-map-fn-return.js +++ b/test/built-ins/Array/from/iter-map-fn-return.js @@ -61,6 +61,10 @@ items[Symbol.iterator] = function() { result = Array.from(items, mapFn); -assert.sameValue(result.length, 2); -assert.sameValue(result[0], firstReturnVal); -assert.sameValue(result[1], secondReturnVal); +assert.sameValue(result.length, 2, 'The value of result.length is expected to be 2'); +assert.sameValue(result[0], firstReturnVal, 'The value of result[0] is expected to equal the value of firstReturnVal'); +assert.sameValue( + result[1], + secondReturnVal, + 'The value of result[1] is expected to equal the value of secondReturnVal' +); diff --git a/test/built-ins/Array/from/iter-map-fn-this-arg.js b/test/built-ins/Array/from/iter-map-fn-this-arg.js index 37574af7b6..b72e77fe71 100644 --- a/test/built-ins/Array/from/iter-map-fn-this-arg.js +++ b/test/built-ins/Array/from/iter-map-fn-this-arg.js @@ -52,6 +52,6 @@ items[Symbol.iterator] = function() { Array.from(items, mapFn, thisVal); -assert.sameValue(thisVals.length, 2); -assert.sameValue(thisVals[0], thisVal, 'First iteration `this` value'); -assert.sameValue(thisVals[1], thisVal, 'Second iteration `this` value'); +assert.sameValue(thisVals.length, 2, 'The value of thisVals.length is expected to be 2'); +assert.sameValue(thisVals[0], thisVal, 'The value of thisVals[0] is expected to equal the value of thisVal'); +assert.sameValue(thisVals[1], thisVal, 'The value of thisVals[1] is expected to equal the value of thisVal'); diff --git a/test/built-ins/Array/from/iter-map-fn-this-non-strict.js b/test/built-ins/Array/from/iter-map-fn-this-non-strict.js index 47287fb16b..dece8f2f4b 100644 --- a/test/built-ins/Array/from/iter-map-fn-this-non-strict.js +++ b/test/built-ins/Array/from/iter-map-fn-this-non-strict.js @@ -55,6 +55,6 @@ items[Symbol.iterator] = function() { Array.from(items, mapFn); -assert.sameValue(thisVals.length, 2); -assert.sameValue(thisVals[0], global, 'First iteration `this` value'); -assert.sameValue(thisVals[1], global, 'Second iteration `this` value'); +assert.sameValue(thisVals.length, 2, 'The value of thisVals.length is expected to be 2'); +assert.sameValue(thisVals[0], global, 'The value of thisVals[0] is expected to equal the value of global'); +assert.sameValue(thisVals[1], global, 'The value of thisVals[1] is expected to equal the value of global'); diff --git a/test/built-ins/Array/from/iter-map-fn-this-strict.js b/test/built-ins/Array/from/iter-map-fn-this-strict.js index 2cf702db44..6ed9ebe4de 100644 --- a/test/built-ins/Array/from/iter-map-fn-this-strict.js +++ b/test/built-ins/Array/from/iter-map-fn-this-strict.js @@ -52,6 +52,6 @@ items[Symbol.iterator] = function() { Array.from(items, mapFn); -assert.sameValue(thisVals.length, 2); -assert.sameValue(thisVals[0], undefined, 'First iteration `this` value'); -assert.sameValue(thisVals[1], undefined, 'Second iteration `this` value'); +assert.sameValue(thisVals.length, 2, 'The value of thisVals.length is expected to be 2'); +assert.sameValue(thisVals[0], undefined, 'The value of thisVals[0] is expected to equal undefined'); +assert.sameValue(thisVals[1], undefined, 'The value of thisVals[1] is expected to equal undefined'); diff --git a/test/built-ins/Array/from/iter-set-elem-prop-err.js b/test/built-ins/Array/from/iter-set-elem-prop-err.js index 206074d9e9..f4ca9d6ebf 100644 --- a/test/built-ins/Array/from/iter-set-elem-prop-err.js +++ b/test/built-ins/Array/from/iter-set-elem-prop-err.js @@ -16,7 +16,7 @@ info: | features: [Symbol.iterator] ---*/ -var C = function() { +var constructorSetsIndex0ConfigurableFalse = function() { Object.defineProperty(this, '0', { writable: true, configurable: false @@ -46,7 +46,7 @@ items[Symbol.iterator] = function() { }; assert.throws(TypeError, function() { - Array.from.call(C, items); -}); + Array.from.call(constructorSetsIndex0ConfigurableFalse, items); +}, 'Array.from.call(constructorSetsIndex0ConfigurableFalse, items) throws a TypeError exception'); -assert.sameValue(closeCount, 1); +assert.sameValue(closeCount, 1, 'The value of closeCount is expected to be 1'); diff --git a/test/built-ins/Array/from/iter-set-elem-prop.js b/test/built-ins/Array/from/iter-set-elem-prop.js index abbdf8d227..bf56e64eb9 100644 --- a/test/built-ins/Array/from/iter-set-elem-prop.js +++ b/test/built-ins/Array/from/iter-set-elem-prop.js @@ -46,5 +46,13 @@ items[Symbol.iterator] = function() { result = Array.from(items); -assert.sameValue(result[0], firstIterResult.value); -assert.sameValue(result[1], secondIterResult.value); +assert.sameValue( + result[0], + firstIterResult.value, + 'The value of result[0] is expected to equal the value of firstIterResult.value' +); +assert.sameValue( + result[1], + secondIterResult.value, + 'The value of result[1] is expected to equal the value of secondIterResult.value' +); diff --git a/test/built-ins/Array/from/iter-set-length-err.js b/test/built-ins/Array/from/iter-set-length-err.js index 0b459ba03f..4ba52503ce 100644 --- a/test/built-ins/Array/from/iter-set-length-err.js +++ b/test/built-ins/Array/from/iter-set-length-err.js @@ -15,9 +15,9 @@ info: | features: [Symbol.iterator] ---*/ -var C = function() {}; +var poisonedPrototypeLength = function() {}; var items = {}; -Object.defineProperty(C.prototype, 'length', { +Object.defineProperty(poisonedPrototypeLength.prototype, 'length', { set: function(_) { throw new Test262Error(); } @@ -33,5 +33,5 @@ items[Symbol.iterator] = function() { }; assert.throws(Test262Error, function() { - Array.from.call(C, items); -}); + Array.from.call(poisonedPrototypeLength, items); +}, 'Array.from.call(poisonedPrototypeLength, items) throws a Test262Error exception'); diff --git a/test/built-ins/Array/from/iter-set-length.js b/test/built-ins/Array/from/iter-set-length.js index 05e084b2fd..b4639f4ddb 100644 --- a/test/built-ins/Array/from/iter-set-length.js +++ b/test/built-ins/Array/from/iter-set-length.js @@ -33,7 +33,7 @@ nextIterResult = lastIterResult = { }; result = Array.from(items); -assert.sameValue(result.length, 0); +assert.sameValue(result.length, 0, 'The value of result.length is expected to be 0'); nextIterResult = { done: false @@ -43,4 +43,4 @@ lastIterResult = { }; result = Array.from(items); -assert.sameValue(result.length, 1); +assert.sameValue(result.length, 1, 'The value of result.length is expected to be 1'); diff --git a/test/built-ins/Array/from/mapfn-is-not-callable-typeerror.js b/test/built-ins/Array/from/mapfn-is-not-callable-typeerror.js index 2275cb725a..c66363d754 100644 --- a/test/built-ins/Array/from/mapfn-is-not-callable-typeerror.js +++ b/test/built-ins/Array/from/mapfn-is-not-callable-typeerror.js @@ -15,20 +15,20 @@ info: | assert.throws(TypeError, function() { Array.from([], null); -}); +}, 'Array.from([], null) throws a TypeError exception'); assert.throws(TypeError, function() { Array.from([], {}); -}); +}, 'Array.from([], {}) throws a TypeError exception'); assert.throws(TypeError, function() { Array.from([], 'string'); -}); +}, 'Array.from([], "string") throws a TypeError exception'); assert.throws(TypeError, function() { Array.from([], true); -}); +}, 'Array.from([], true) throws a TypeError exception'); assert.throws(TypeError, function() { Array.from([], 42); -}); +}, 'Array.from([], 42) throws a TypeError exception'); diff --git a/test/built-ins/Array/from/mapfn-is-symbol-throws.js b/test/built-ins/Array/from/mapfn-is-symbol-throws.js index 58b248aba2..7fd7eb9766 100644 --- a/test/built-ins/Array/from/mapfn-is-symbol-throws.js +++ b/test/built-ins/Array/from/mapfn-is-symbol-throws.js @@ -17,4 +17,4 @@ features: assert.throws(TypeError, function() { Array.from([], Symbol('1')); -}); +}, 'Array.from([], Symbol("1")) throws a TypeError exception'); diff --git a/test/built-ins/Array/from/mapfn-throws-exception.js b/test/built-ins/Array/from/mapfn-throws-exception.js index a87898bf85..6f2a42c0ce 100644 --- a/test/built-ins/Array/from/mapfn-throws-exception.js +++ b/test/built-ins/Array/from/mapfn-throws-exception.js @@ -9,10 +9,10 @@ es6id: 22.1.2.1 var array = [2, 4, 8, 16, 32, 64, 128]; -function mapFn(value, index, obj) { +function mapFnThrows(value, index, obj) { throw new Test262Error(); } assert.throws(Test262Error, function() { - Array.from(array, mapFn); -}); + Array.from(array, mapFnThrows); +}, 'Array.from(array, mapFnThrows) throws a Test262Error exception'); diff --git a/test/built-ins/Array/from/not-a-constructor.js b/test/built-ins/Array/from/not-a-constructor.js index 87f80f7004..4ed9820f0b 100644 --- a/test/built-ins/Array/from/not-a-constructor.js +++ b/test/built-ins/Array/from/not-a-constructor.js @@ -25,5 +25,5 @@ assert.sameValue(isConstructor(Array.from), false, 'isConstructor(Array.from) mu assert.throws(TypeError, () => { new Array.from([]); -}, '`new Array.from([])` throws TypeError'); +}, 'new Array.from([]) throws a TypeError exception'); diff --git a/test/built-ins/Array/from/proto-from-ctor-realm.js b/test/built-ins/Array/from/proto-from-ctor-realm.js index 4439b49646..5bc068c60e 100644 --- a/test/built-ins/Array/from/proto-from-ctor-realm.js +++ b/test/built-ins/Array/from/proto-from-ctor-realm.js @@ -28,4 +28,8 @@ C.prototype = null; var a = Array.from.call(C, []); -assert.sameValue(Object.getPrototypeOf(a), other.Object.prototype); +assert.sameValue( + Object.getPrototypeOf(a), + other.Object.prototype, + 'Object.getPrototypeOf(Array.from.call(C, [])) returns other.Object.prototype' +); diff --git a/test/built-ins/Array/from/source-array-boundary.js b/test/built-ins/Array/from/source-array-boundary.js index 9dad817293..95c60afe43 100644 --- a/test/built-ins/Array/from/source-array-boundary.js +++ b/test/built-ins/Array/from/source-array-boundary.js @@ -12,17 +12,17 @@ var arrayIndex = -1; function mapFn(value, index) { this.arrayIndex++; - assert.sameValue(value, array[this.arrayIndex], "Value mismatch in mapFn at index " + index + "."); - assert.sameValue(index, this.arrayIndex, "Index mismatch in mapFn."); + assert.sameValue(value, array[this.arrayIndex], 'The value of value is expected to equal the value of array[this.arrayIndex]'); + assert.sameValue(index, this.arrayIndex, 'The value of index is expected to equal the value of this.arrayIndex'); return value; } var a = Array.from(array, mapFn, this); -assert.sameValue(a.length, array.length, "Length mismatch."); -assert.sameValue(a[0], Number.MAX_VALUE, "Element mismatch for mapped array at index 0."); -assert.sameValue(a[1], Number.MIN_VALUE, "Element mismatch for mapped array at index 1."); -assert.sameValue(a[2], Number.NaN, "Element mismatch for mapped array at index 2."); -assert.sameValue(a[3], Number.NEGATIVE_INFINITY, "Element mismatch for mapped array at index 3."); -assert.sameValue(a[4], Number.POSITIVE_INFINITY, "Element mismatch for mapped array at index 4."); +assert.sameValue(a.length, array.length, 'The value of a.length is expected to equal the value of array.length'); +assert.sameValue(a[0], Number.MAX_VALUE, 'The value of a[0] is expected to equal the value of Number.MAX_VALUE'); +assert.sameValue(a[1], Number.MIN_VALUE, 'The value of a[1] is expected to equal the value of Number.MIN_VALUE'); +assert.sameValue(a[2], Number.NaN, 'The value of a[2] is expected to equal the value of Number.NaN'); +assert.sameValue(a[3], Number.NEGATIVE_INFINITY, 'The value of a[3] is expected to equal the value of Number.NEGATIVE_INFINITY'); +assert.sameValue(a[4], Number.POSITIVE_INFINITY, 'The value of a[4] is expected to equal the value of Number.POSITIVE_INFINITY'); diff --git a/test/built-ins/Array/from/source-object-constructor.js b/test/built-ins/Array/from/source-object-constructor.js index 225be5919c..9c6e3d555e 100644 --- a/test/built-ins/Array/from/source-object-constructor.js +++ b/test/built-ins/Array/from/source-object-constructor.js @@ -8,4 +8,8 @@ esid: sec-array.from es6id: 22.1.2.1 ---*/ -assert.sameValue(Array.from.call(Object, []).constructor, Object); +assert.sameValue( + Array.from.call(Object, []).constructor, + Object, + 'The value of Array.from.call(Object, []).constructor is expected to equal the value of Object' +); diff --git a/test/built-ins/Array/from/source-object-iterator-1.js b/test/built-ins/Array/from/source-object-iterator-1.js index 6ac364ac54..d667de22ff 100644 --- a/test/built-ins/Array/from/source-object-iterator-1.js +++ b/test/built-ins/Array/from/source-object-iterator-1.js @@ -29,4 +29,4 @@ var obj = { }; assert.throws(Test262Error, function() { Array.from(obj); -}); +}, 'Array.from(obj) throws a Test262Error exception'); diff --git a/test/built-ins/Array/from/source-object-iterator-2.js b/test/built-ins/Array/from/source-object-iterator-2.js index 619405c347..f573654605 100644 --- a/test/built-ins/Array/from/source-object-iterator-2.js +++ b/test/built-ins/Array/from/source-object-iterator-2.js @@ -31,7 +31,7 @@ var obj = { } }; var a = Array.from.call(Object, obj); -assert.sameValue(typeof a, typeof {}, "The returned type is expected to be object."); +assert.sameValue(typeof a, typeof {}, 'The value of `typeof a` is expected to be typeof {}'); for (var j = 0; j < a.length; j++) { - assert.sameValue(a[j], array[j], "Elements mismatch at " + j + "."); + assert.sameValue(a[j], array[j], 'The value of a[j] is expected to equal the value of array[j]'); } diff --git a/test/built-ins/Array/from/source-object-length-set-elem-prop-err.js b/test/built-ins/Array/from/source-object-length-set-elem-prop-err.js index 2de74eecfa..28789e003f 100644 --- a/test/built-ins/Array/from/source-object-length-set-elem-prop-err.js +++ b/test/built-ins/Array/from/source-object-length-set-elem-prop-err.js @@ -38,7 +38,7 @@ var A1 = function(_length) { assert.throws(TypeError, function() { Array.from.call(A1, items); -}); +}, 'Array.from.call(A1, items) throws a TypeError exception'); var A2 = function(_length) { Object.defineProperty(this, "0", { @@ -49,4 +49,4 @@ var A2 = function(_length) { assert.throws(TypeError, function() { Array.from.call(A2, items); -}); +}, 'Array.from.call(A2, items) throws a TypeError exception'); diff --git a/test/built-ins/Array/from/source-object-length.js b/test/built-ins/Array/from/source-object-length.js index 4127f5ec07..77e373a0af 100644 --- a/test/built-ins/Array/from/source-object-length.js +++ b/test/built-ins/Array/from/source-object-length.js @@ -21,5 +21,5 @@ var obj = { delete obj[2]; var a = Array.from(obj); for (var j = 0; j < expectedArray.length; j++) { - assert.sameValue(a[j], expectedArray[j], "Elements mismatch at " + j + "."); + assert.sameValue(a[j], expectedArray[j], 'The value of a[j] is expected to equal the value of expectedArray[j]'); } diff --git a/test/built-ins/Array/from/source-object-missing.js b/test/built-ins/Array/from/source-object-missing.js index 3c55030dac..ec4c935fae 100644 --- a/test/built-ins/Array/from/source-object-missing.js +++ b/test/built-ins/Array/from/source-object-missing.js @@ -16,7 +16,7 @@ var obj = { }; var a = Array.from.call(Object, obj); -assert.sameValue(typeof a, "object", "The returned type is expected to be object."); +assert.sameValue(typeof a, "object", 'The value of `typeof a` is expected to be "object"'); for (var j = 0; j < a.length; j++) { - assert.sameValue(a[j], array[j], "Elements mismatch at " + j + "."); + assert.sameValue(a[j], array[j], 'The value of a[j] is expected to equal the value of array[j]'); } diff --git a/test/built-ins/Array/from/source-object-without.js b/test/built-ins/Array/from/source-object-without.js index fbb1877822..f3832147a3 100644 --- a/test/built-ins/Array/from/source-object-without.js +++ b/test/built-ins/Array/from/source-object-without.js @@ -15,4 +15,4 @@ var obj = { } var a = Array.from(obj); -assert.sameValue(a.length, 0, "Expected an array of length 0."); +assert.sameValue(a.length, 0, 'The value of a.length is expected to be 0'); diff --git a/test/built-ins/Array/from/this-null.js b/test/built-ins/Array/from/this-null.js index c0fa8be227..0ebfe9af10 100644 --- a/test/built-ins/Array/from/this-null.js +++ b/test/built-ins/Array/from/this-null.js @@ -8,5 +8,5 @@ description: Does not throw if this is null var result = Array.from.call(null, []); -assert(result instanceof Array, 'Does not throw if this is null'); -assert.sameValue(result.length, 0, 'result.length'); +assert(result instanceof Array, 'The result of evaluating (result instanceof Array) is expected to be true'); +assert.sameValue(result.length, 0, 'The value of result.length is expected to be 0'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-1.js b/test/built-ins/Array/isArray/15.4.3.2-0-1.js index 15d6b000b2..d5f540fa42 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-0-1.js +++ b/test/built-ins/Array/isArray/15.4.3.2-0-1.js @@ -9,4 +9,4 @@ description: Array.isArray must exist as a function var f = Array.isArray; -assert.sameValue(typeof(f), "function", 'typeof(f)'); +assert.sameValue(typeof f, "function", 'The value of `typeof f` is expected to be "function"'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-2.js b/test/built-ins/Array/isArray/15.4.3.2-0-2.js index 9b18fb0a5e..5b38a2519d 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-0-2.js +++ b/test/built-ins/Array/isArray/15.4.3.2-0-2.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-0-2 description: Array.isArray must exist as a function taking 1 parameter ---*/ -assert.sameValue(Array.isArray.length, 1, 'Array.isArray.length'); +assert.sameValue(Array.isArray.length, 1, 'The value of Array.isArray.length is expected to be 1'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-3.js b/test/built-ins/Array/isArray/15.4.3.2-0-3.js index 299aad0fe8..c9670aeb47 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-0-3.js +++ b/test/built-ins/Array/isArray/15.4.3.2-0-3.js @@ -7,7 +7,4 @@ es5id: 15.4.3.2-0-3 description: Array.isArray return true if its argument is an Array ---*/ -var a = []; -var b = Array.isArray(a); - -assert.sameValue(b, true, 'b'); +assert.sameValue(Array.isArray([]), true, 'Array.isArray([]) must return true'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-4.js b/test/built-ins/Array/isArray/15.4.3.2-0-4.js index e6b44cd13c..3ec8df1f1e 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-0-4.js +++ b/test/built-ins/Array/isArray/15.4.3.2-0-4.js @@ -6,17 +6,9 @@ esid: sec-array.isarray description: Array.isArray return false if its argument is not an Array ---*/ -var b_num = Array.isArray(42); -var b_undef = Array.isArray(undefined); -var b_bool = Array.isArray(true); -var b_str = Array.isArray("abc"); -var b_obj = Array.isArray({}); -var b_null = Array.isArray(null); - - -assert.sameValue(b_num, false, 'b_num'); -assert.sameValue(b_undef, false, 'b_undef'); -assert.sameValue(b_bool, false, 'b_bool'); -assert.sameValue(b_str, false, 'b_str'); -assert.sameValue(b_obj, false, 'b_obj'); -assert.sameValue(b_null, false, 'b_null'); +assert.sameValue(Array.isArray(42), false, 'Array.isArray(42) must return false'); +assert.sameValue(Array.isArray(undefined), false, 'Array.isArray(undefined) must return false'); +assert.sameValue(Array.isArray(true), false, 'Array.isArray(true) must return false'); +assert.sameValue(Array.isArray("abc"), false, 'Array.isArray("abc") must return false'); +assert.sameValue(Array.isArray({}), false, 'Array.isArray({}) must return false'); +assert.sameValue(Array.isArray(null), false, 'Array.isArray(null) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-5.js b/test/built-ins/Array/isArray/15.4.3.2-0-5.js index f6bc9d8235..c8f83b38ea 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-0-5.js +++ b/test/built-ins/Array/isArray/15.4.3.2-0-5.js @@ -9,6 +9,4 @@ description: > (Array.prototype) ---*/ -var b = Array.isArray(Array.prototype); - -assert.sameValue(b, true, 'b'); +assert.sameValue(Array.isArray(Array.prototype), true, 'Array.isArray(Array.prototype) must return true'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-6.js b/test/built-ins/Array/isArray/15.4.3.2-0-6.js index 1d28be623a..38d6282593 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-0-6.js +++ b/test/built-ins/Array/isArray/15.4.3.2-0-6.js @@ -7,7 +7,4 @@ es5id: 15.4.3.2-0-6 description: Array.isArray return true if its argument is an Array (new Array()) ---*/ -var a = new Array(10); -var b = Array.isArray(a); - -assert.sameValue(b, true, 'b'); +assert.sameValue(Array.isArray(new Array(10)), true, 'Array.isArray(new Array(10)) must return true'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-0-7.js b/test/built-ins/Array/isArray/15.4.3.2-0-7.js index 87d7f6165f..1d9e6161d4 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-0-7.js +++ b/test/built-ins/Array/isArray/15.4.3.2-0-7.js @@ -7,8 +7,4 @@ es5id: 15.4.3.2-0-7 description: Array.isArray returns false if its argument is not an Array ---*/ -var o = new Object(); -o[12] = 13; -var b = Array.isArray(o); - -assert.sameValue(b, false, 'b'); +assert.sameValue(Array.isArray({}), false, 'Array.isArray({}) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-1.js b/test/built-ins/Array/isArray/15.4.3.2-1-1.js index 3c90df63dc..26b8b8e033 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-1.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-1.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-1 description: Array.isArray applied to boolean primitive ---*/ -assert.sameValue(Array.isArray(true), false, 'Array.isArray(true)'); +assert.sameValue(Array.isArray(true), false, 'Array.isArray(true) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-10.js b/test/built-ins/Array/isArray/15.4.3.2-1-10.js index f7f05f3594..cfaa587608 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-10.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-10.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-10 description: Array.isArray applied to RegExp object ---*/ -assert.sameValue(Array.isArray(new RegExp()), false, 'Array.isArray(new RegExp())'); +assert.sameValue(Array.isArray(new RegExp()), false, 'Array.isArray(new RegExp()) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-11.js b/test/built-ins/Array/isArray/15.4.3.2-1-11.js index 98b3d9286d..28c8af6fb7 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-11.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-11.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-11 description: Array.isArray applied to the JSON object ---*/ -assert.sameValue(Array.isArray(JSON), false, 'Array.isArray(JSON)'); +assert.sameValue(Array.isArray(JSON), false, 'Array.isArray(JSON) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-12.js b/test/built-ins/Array/isArray/15.4.3.2-1-12.js index 338db61e79..6d6b0d35a8 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-12.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-12.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-12 description: Array.isArray applied to Error object ---*/ -assert.sameValue(Array.isArray(new SyntaxError()), false, 'Array.isArray(new SyntaxError())'); +assert.sameValue(Array.isArray(new SyntaxError()), false, 'Array.isArray(new SyntaxError()) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-13.js b/test/built-ins/Array/isArray/15.4.3.2-1-13.js index cbc0721a67..6d18149278 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-13.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-13.js @@ -13,4 +13,4 @@ var arg; arg = arguments; }(1, 2, 3)); -assert.sameValue(Array.isArray(arg), false, 'Array.isArray(arg)'); +assert.sameValue(Array.isArray(arg), false, 'Array.isArray(arguments) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-15.js b/test/built-ins/Array/isArray/15.4.3.2-1-15.js index 858894f958..c194ea1a09 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-15.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-15.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-15 description: Array.isArray applied to the global object ---*/ -assert.sameValue(Array.isArray(this), false, 'Array.isArray(this)'); +assert.sameValue(Array.isArray(this), false, 'Array.isArray(this) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-2.js b/test/built-ins/Array/isArray/15.4.3.2-1-2.js index 8c621cb621..f3f03deb31 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-2.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-2.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-2 description: Array.isArray applied to Boolean Object ---*/ -assert.sameValue(Array.isArray(new Boolean(false)), false, 'Array.isArray(new Boolean(false))'); +assert.sameValue(Array.isArray(new Boolean(false)), false, 'Array.isArray(new Boolean(false)) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-3.js b/test/built-ins/Array/isArray/15.4.3.2-1-3.js index 615d130ab5..ad5f4ca714 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-3.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-3.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-3 description: Array.isArray applied to number primitive ---*/ -assert.sameValue(Array.isArray(5), false, 'Array.isArray(5)'); +assert.sameValue(Array.isArray(5), false, 'Array.isArray(5) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-4.js b/test/built-ins/Array/isArray/15.4.3.2-1-4.js index 32f925457b..bb4d2dadf5 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-4.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-4.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-4 description: Array.isArray applied to Number object ---*/ -assert.sameValue(Array.isArray(new Number(-3)), false, 'Array.isArray(new Number(-3))'); +assert.sameValue(Array.isArray(new Number(-3)), false, 'Array.isArray(new Number(-3)) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-5.js b/test/built-ins/Array/isArray/15.4.3.2-1-5.js index 3d5f57d8d4..4061a1d7e0 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-5.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-5.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-5 description: Array.isArray applied to string primitive ---*/ -assert.sameValue(Array.isArray("abc"), false, 'Array.isArray("abc")'); +assert.sameValue(Array.isArray("abc"), false, 'Array.isArray("abc") must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-6.js b/test/built-ins/Array/isArray/15.4.3.2-1-6.js index 8c7c190d97..e28df62efc 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-6.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-6.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-6 description: Array.isArray applied to String object ---*/ -assert.sameValue(Array.isArray(new String("hello\nworld\\!")), false, 'Array.isArray(new String("hello\nworld\\!"))'); +assert.sameValue(Array.isArray(new String("hello\nworld\\!")), false, 'Array.isArray(new String("hello\\nworld\\\\!")) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-7.js b/test/built-ins/Array/isArray/15.4.3.2-1-7.js index 412226c330..ec52af4828 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-7.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-7.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-7 description: Array.isArray applied to Function object ---*/ -assert.sameValue(Array.isArray(function() {}), false, 'Array.isArray(function () { })'); +assert.sameValue(Array.isArray(function() {}), false, 'Array.isArray(function() {}) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-8.js b/test/built-ins/Array/isArray/15.4.3.2-1-8.js index c95344a415..6dabc2b19f 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-8.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-8.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-8 description: Array.isArray applied to the Math object ---*/ -assert.sameValue(Array.isArray(Math), false, 'Array.isArray(Math)'); +assert.sameValue(Array.isArray(Math), false, 'Array.isArray(Math) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-9.js b/test/built-ins/Array/isArray/15.4.3.2-1-9.js index 177435f060..5d4eab1d01 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-9.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-9.js @@ -7,4 +7,4 @@ es5id: 15.4.3.2-1-9 description: Array.isArray applied to Date object ---*/ -assert.sameValue(Array.isArray(new Date()), false, 'Array.isArray(new Date())'); +assert.sameValue(Array.isArray(new Date()), false, 'Array.isArray(new Date()) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-2-1.js b/test/built-ins/Array/isArray/15.4.3.2-2-1.js index d0a5ed7fca..c0311c5bd9 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-2-1.js +++ b/test/built-ins/Array/isArray/15.4.3.2-2-1.js @@ -13,4 +13,4 @@ Con.prototype = proto; var child = new Con(); -assert.sameValue(Array.isArray(child), false, 'Array.isArray(child)'); +assert.sameValue(Array.isArray(child), false, 'Array.isArray(new Con()) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-2-2.js b/test/built-ins/Array/isArray/15.4.3.2-2-2.js index d0bec2d468..3e06236319 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-2-2.js +++ b/test/built-ins/Array/isArray/15.4.3.2-2-2.js @@ -15,4 +15,4 @@ Con.prototype = proto; var child = new Con(); -assert.sameValue(Array.isArray(child), false, 'Array.isArray(child)'); +assert.sameValue(Array.isArray(child), false, 'Array.isArray(new Con()) must return false'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-2-3.js b/test/built-ins/Array/isArray/15.4.3.2-2-3.js index 02da7c1431..f735b29cb8 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-2-3.js +++ b/test/built-ins/Array/isArray/15.4.3.2-2-3.js @@ -13,4 +13,4 @@ assert.sameValue(Array.isArray({ 0: 12, 1: 9, length: 2 -}), false, 'Array.isArray({ 0: 12, 1: 9, length: 2 })'); +}), false, 'Array.isArray({0: 12, 1: 9, length: 2}) must return false'); diff --git a/test/built-ins/Array/isArray/name.js b/test/built-ins/Array/isArray/name.js index 96cdbb0fd4..ed23a4a875 100644 --- a/test/built-ins/Array/isArray/name.js +++ b/test/built-ins/Array/isArray/name.js @@ -20,7 +20,7 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.isArray.name, "isArray"); +assert.sameValue(Array.isArray.name, "isArray", 'The value of Array.isArray.name is expected to be "isArray"'); verifyNotEnumerable(Array.isArray, "name"); verifyNotWritable(Array.isArray, "name"); diff --git a/test/built-ins/Array/isArray/not-a-constructor.js b/test/built-ins/Array/isArray/not-a-constructor.js index 4e073d3f7e..a40882453e 100644 --- a/test/built-ins/Array/isArray/not-a-constructor.js +++ b/test/built-ins/Array/isArray/not-a-constructor.js @@ -25,5 +25,5 @@ assert.sameValue(isConstructor(Array.isArray), false, 'isConstructor(Array.isArr assert.throws(TypeError, () => { new Array.isArray([]); -}, '`new Array.isArray([])` throws TypeError'); +}, 'new Array.isArray([]) throws a TypeError exception'); diff --git a/test/built-ins/Array/isArray/proxy-revoked.js b/test/built-ins/Array/isArray/proxy-revoked.js index ba8aa6f2a4..4d21a41524 100644 --- a/test/built-ins/Array/isArray/proxy-revoked.js +++ b/test/built-ins/Array/isArray/proxy-revoked.js @@ -25,4 +25,4 @@ handle.revoke(); assert.throws(TypeError, function() { Array.isArray(handle.proxy); -}); +}, 'Array.isArray(handle.proxy) throws a TypeError exception'); diff --git a/test/built-ins/Array/isArray/proxy.js b/test/built-ins/Array/isArray/proxy.js index 7af7d9ae96..8d6edd72d2 100644 --- a/test/built-ins/Array/isArray/proxy.js +++ b/test/built-ins/Array/isArray/proxy.js @@ -23,8 +23,8 @@ var objectProxy = new Proxy({}, {}); var arrayProxy = new Proxy([], {}); var arrayProxyProxy = new Proxy(arrayProxy, {}); -assert.sameValue(Array.isArray(objectProxy), false); -assert.sameValue(Array.isArray(arrayProxy), true, 'proxy for array'); +assert.sameValue(Array.isArray(objectProxy), false, 'Array.isArray(new Proxy({}, {})) must return false'); +assert.sameValue(Array.isArray(arrayProxy), true, 'Array.isArray(new Proxy([], {})) must return true'); assert.sameValue( - Array.isArray(arrayProxyProxy), true, 'proxy for proxy for array' + Array.isArray(arrayProxyProxy), true, 'Array.isArray(new Proxy(arrayProxy, {})) must return true' ); diff --git a/test/built-ins/Array/length.js b/test/built-ins/Array/length.js index 0d05fccf54..81d052603e 100644 --- a/test/built-ins/Array/length.js +++ b/test/built-ins/Array/length.js @@ -17,7 +17,7 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.length, 1); +assert.sameValue(Array.length, 1, 'The value of Array.length is expected to be 1'); verifyNotEnumerable(Array, 'length'); verifyNotWritable(Array, 'length'); diff --git a/test/built-ins/Array/length/15.4.5.1-3.d-1.js b/test/built-ins/Array/length/15.4.5.1-3.d-1.js index 9525856720..246419f6a8 100644 --- a/test/built-ins/Array/length/15.4.5.1-3.d-1.js +++ b/test/built-ins/Array/length/15.4.5.1-3.d-1.js @@ -12,4 +12,4 @@ description: > assert.throws(RangeError, function() { [].length = 4294967296; -}); +}, '[].length = 4294967296 throws a RangeError exception'); diff --git a/test/built-ins/Array/length/15.4.5.1-3.d-2.js b/test/built-ins/Array/length/15.4.5.1-3.d-2.js index 2162edb4a2..15c7fd51eb 100644 --- a/test/built-ins/Array/length/15.4.5.1-3.d-2.js +++ b/test/built-ins/Array/length/15.4.5.1-3.d-2.js @@ -12,4 +12,4 @@ description: > assert.throws(RangeError, function() { [].length = 4294967297; -}); +}, '[].length = 4294967297 throws a RangeError exception'); diff --git a/test/built-ins/Array/length/15.4.5.1-3.d-3.js b/test/built-ins/Array/length/15.4.5.1-3.d-3.js index 7c03867da7..5129809c0d 100644 --- a/test/built-ins/Array/length/15.4.5.1-3.d-3.js +++ b/test/built-ins/Array/length/15.4.5.1-3.d-3.js @@ -10,4 +10,4 @@ description: Set array length property to max value 4294967295 (2**32-1,) var a = []; a.length = 4294967295; -assert.sameValue(a.length, 4294967295, 'a.length'); +assert.sameValue(a.length, 4294967295, 'The value of a.length is expected to be 4294967295'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A1.1_T1.js b/test/built-ins/Array/length/S15.4.2.2_A1.1_T1.js index 191ee16c1d..dcb71efd62 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A1.1_T1.js +++ b/test/built-ins/Array/length/S15.4.2.2_A1.1_T1.js @@ -16,6 +16,4 @@ description: > //CHECK#1 Array.prototype.myproperty = 1; var x = new Array(0); -if (x.myproperty !== 1) { - throw new Test262Error('#1: Array.prototype.myproperty = 1; var x = new Array(0); x.myproperty === 1. Actual: ' + (x.myproperty)); -} +assert.sameValue(x.myproperty, 1, 'The value of x.myproperty is expected to be 1'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A1.1_T2.js b/test/built-ins/Array/length/S15.4.2.2_A1.1_T2.js index a6743cf2ef..67335367cd 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A1.1_T2.js +++ b/test/built-ins/Array/length/S15.4.2.2_A1.1_T2.js @@ -14,6 +14,4 @@ description: Array.prototype.toString = Object.prototype.toString //CHECK#1 Array.prototype.toString = Object.prototype.toString; var x = new Array(0); -if (x.toString() !== "[object " + "Array" + "]") { - throw new Test262Error('#1: Array.prototype.toString = Object.prototype.toString; var x = new Array(0); x.toString() === "[object " + "Array" + "]". Actual: ' + (x.toString())); -} +assert.sameValue(x.toString(), "[object Array]", 'x.toString() must return "[object Array]"'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A1.1_T3.js b/test/built-ins/Array/length/S15.4.2.2_A1.1_T3.js index 886e9c801e..3a0d6d34f8 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A1.1_T3.js +++ b/test/built-ins/Array/length/S15.4.2.2_A1.1_T3.js @@ -11,7 +11,8 @@ es5id: 15.4.2.2_A1.1_T3 description: Checking use isPrototypeOf ---*/ -//CHECK#1 -if (Array.prototype.isPrototypeOf(new Array(0)) !== true) { - throw new Test262Error('#1: Array.prototype.isPrototypeOf(new Array(0)) === true. Actual: ' + (Array.prototype.isPrototypeOf(new Array(0)))); -} +assert.sameValue( + Array.prototype.isPrototypeOf(new Array(0)), + true, + 'Array.prototype.isPrototypeOf(new Array(0)) must return true' +); diff --git a/test/built-ins/Array/length/S15.4.2.2_A1.2_T1.js b/test/built-ins/Array/length/S15.4.2.2_A1.2_T1.js index 21c10ee36d..e3e42f096f 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A1.2_T1.js +++ b/test/built-ins/Array/length/S15.4.2.2_A1.2_T1.js @@ -10,7 +10,4 @@ description: Checking use Object.prototype.toString //CHECK#1 var x = new Array(0); -x.getClass = Object.prototype.toString; -if (x.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#1: var x = new Array(0); x.getClass = Object.prototype.toString; x is Array object. Actual: ' + (x.getClass())); -} +assert.sameValue(Object.prototype.toString.call(x), "[object Array]", 'Object.prototype.toString.call(new Array(0)) must return "[object Array]"'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.1_T1.js b/test/built-ins/Array/length/S15.4.2.2_A2.1_T1.js index 0e26aa7fc4..bb3d4b5dc6 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.1_T1.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.1_T1.js @@ -12,18 +12,12 @@ description: Array constructor is given one argument //CHECK#1 var x = new Array(0); -if (x.length !== 0) { - throw new Test262Error('#1: var x = new Array(0); x.length === 0. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0'); //CHECK#2 var x = new Array(1); -if (x.length !== 1) { - throw new Test262Error('#2: var x = new Array(1); x.length === 1. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); //CHECK#3 var x = new Array(4294967295); -if (x.length !== 4294967295) { - throw new Test262Error('#3: var x = new Array(4294967295); x.length === 4294967295. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 4294967295, 'The value of x.length is expected to be 4294967295'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js b/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js index 38a1c4c0d9..c2464d6b70 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js @@ -15,9 +15,11 @@ try { new Array(-1); throw new Test262Error('#1.1: new Array(-1) throw RangeError. Actual: ' + (new Array(-1))); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#1.2: new Array(-1) throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#2 @@ -25,9 +27,11 @@ try { new Array(4294967296); throw new Test262Error('#2.1: new Array(4294967296) throw RangeError. Actual: ' + (new Array(4294967296))); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#2.2: new Array(4294967296) throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#3 @@ -35,7 +39,9 @@ try { new Array(4294967297); throw new Test262Error('#3.1: new Array(4294967297) throw RangeError. Actual: ' + (new Array(4294967297))); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#3.2: new Array(4294967297) throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js b/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js index e2d0236f61..f60205a1d5 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js @@ -15,9 +15,11 @@ try { new Array(NaN); throw new Test262Error('#1.1: new Array(NaN) throw RangeError. Actual: ' + (new Array(NaN))); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#1.2: new Array(NaN) throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#2 @@ -25,9 +27,11 @@ try { new Array(Number.POSITIVE_INFINITY); throw new Test262Error('#2.1: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.POSITIVE_INFINITY))); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#2.2: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#3 @@ -35,7 +39,9 @@ try { new Array(Number.NEGATIVE_INFINITY); throw new Test262Error('#3.1: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.NEGATIVE_INFINITY))); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#3.2: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js b/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js index 1acd57d360..3422a6e769 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js @@ -15,9 +15,11 @@ try { new Array(1.5); throw new Test262Error('#1.1: new Array(1.5) throw RangeError. Actual: ' + (new Array(1.5))); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#1.2: new Array(1.5) throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#2 @@ -25,9 +27,11 @@ try { new Array(Number.MAX_VALUE); throw new Test262Error('#2.1: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (new Array(Number.MAX_VALUE))); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#2.2: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#3 @@ -35,7 +39,9 @@ try { new Array(Number.MIN_VALUE); throw new Test262Error('#3.1: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (new Array(Number.MIN_VALUE))); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#3.2: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.3_T1.js b/test/built-ins/Array/length/S15.4.2.2_A2.3_T1.js index ef62e29e9c..d8956ca4a6 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.3_T1.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.3_T1.js @@ -13,24 +13,10 @@ description: Checking for null and undefined var x = new Array(null); -//CHECK#1 -if (x.length !== 1) { - throw new Test262Error('#1: var x = new Array(null); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#2 -if (x[0] !== null) { - throw new Test262Error('#2: var x = new Array(null); x[0] === null. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], null, 'The value of x[0] is expected to be null'); var x = new Array(undefined); -//CHECK#3 -if (x.length !== 1) { - throw new Test262Error('#3: var x = new Array(undefined); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#4 -if (x[0] !== undefined) { - throw new Test262Error('#4: var x = new Array(undefined); x[0] === undefined. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.3_T2.js b/test/built-ins/Array/length/S15.4.2.2_A2.3_T2.js index 46159298ca..8654b98203 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.3_T2.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.3_T2.js @@ -13,25 +13,11 @@ description: Checking for boolean primitive and Boolean object var x = new Array(true); -//CHECK#1 -if (x.length !== 1) { - throw new Test262Error('#1: var x = new Array(true); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#2 -if (x[0] !== true) { - throw new Test262Error('#2: var x = new Array(true); x[0] === true. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], true, 'The value of x[0] is expected to be true'); var obj = new Boolean(false); var x = new Array(obj); -//CHECK#3 -if (x.length !== 1) { - throw new Test262Error('#3: var obj = new Boolean(false); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#4 -if (x[0] !== obj) { - throw new Test262Error('#4: var obj = new Boolean(false); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], obj, 'The value of x[0] is expected to equal the value of obj'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.3_T3.js b/test/built-ins/Array/length/S15.4.2.2_A2.3_T3.js index 777cab831f..52b15b20d6 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.3_T3.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.3_T3.js @@ -13,25 +13,11 @@ description: Checking for boolean primitive and Boolean object var x = new Array("1"); -//CHECK#1 -if (x.length !== 1) { - throw new Test262Error('#1: var x = new Array("1"); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#2 -if (x[0] !== "1") { - throw new Test262Error('#2: var x = new Array("1"); x[0] === "1". Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], "1", 'The value of x[0] is expected to be "1"'); var obj = new String("0"); var x = new Array(obj); -//CHECK#3 -if (x.length !== 1) { - throw new Test262Error('#3: var obj = new String("0"); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#4 -if (x[0] !== obj) { - throw new Test262Error('#4: var obj = new String("0"); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], obj, 'The value of x[0] is expected to equal the value of obj'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.3_T4.js b/test/built-ins/Array/length/S15.4.2.2_A2.3_T4.js index 1cc04babe7..b9e15435f1 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.3_T4.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.3_T4.js @@ -14,38 +14,17 @@ description: Checking for Number object var obj = new Number(0); var x = new Array(obj); -//CHECK#1 -if (x.length !== 1) { - throw new Test262Error('#1: var obj = new Number(0); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#2 -if (x[0] !== obj) { - throw new Test262Error('#2: var obj = new Number(0); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], obj, 'The value of x[0] is expected to equal the value of obj'); var obj = new Number(1); var x = new Array(obj); -//CHECK#3 -if (x.length !== 1) { - throw new Test262Error('#3: var obj = new Number(1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#4 -if (x[0] !== obj) { - throw new Test262Error('#4: var obj = new Number(1); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], obj, 'The value of x[0] is expected to equal the value of obj'); var obj = new Number(4294967295); var x = new Array(obj); -//CHECK#5 -if (x.length !== 1) { - throw new Test262Error('#5: var obj = new Number(4294967295); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#6 -if (x[0] !== obj) { - throw new Test262Error('#6: var obj = new Number(4294967295); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], obj, 'The value of x[0] is expected to equal the value of obj'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.3_T5.js b/test/built-ins/Array/length/S15.4.2.2_A2.3_T5.js index b6e75a3135..b8309614f4 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.3_T5.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.3_T5.js @@ -14,38 +14,17 @@ description: Checking for Number object var obj = new Number(-1); var x = new Array(obj); -//CHECK#1 -if (x.length !== 1) { - throw new Test262Error('#1: var obj = new Number(-1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#2 -if (x[0] !== obj) { - throw new Test262Error('#2: var obj = new Number(-1); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], obj, 'The value of x[0] is expected to equal the value of obj'); var obj = new Number(4294967296); var x = new Array(obj); -//CHECK#3 -if (x.length !== 1) { - throw new Test262Error('#3: var obj = new Number(4294967296); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#4 -if (x[0] !== obj) { - throw new Test262Error('#4: var obj = new Number(4294967296); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], obj, 'The value of x[0] is expected to equal the value of obj'); var obj = new Number(4294967297); var x = new Array(obj); -//CHECK#5 -if (x.length !== 1) { - throw new Test262Error('#5: var obj = new Number(4294967297); var x = new Array(obj); x.length === 1. Actual: ' + (x.length)); -} - -//CHECK#6 -if (x[0] !== obj) { - throw new Test262Error('#6: var obj = new Number(4294967297); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0])); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); +assert.sameValue(x[0], obj, 'The value of x[0] is expected to equal the value of obj'); diff --git a/test/built-ins/Array/length/S15.4.4_A1.3_T1.js b/test/built-ins/Array/length/S15.4.4_A1.3_T1.js index 0f00555bbd..8c474f7501 100644 --- a/test/built-ins/Array/length/S15.4.4_A1.3_T1.js +++ b/test/built-ins/Array/length/S15.4.4_A1.3_T1.js @@ -8,7 +8,4 @@ es5id: 15.4.4_A1.3_T1 description: Array.prototype.length === 0 ---*/ -//CHECK#1 -if (Array.prototype.length !== 0) { - throw new Test262Error('#1.1: Array.prototype.length === 0. Actual: ' + (Array.prototype.length)); -} +assert.sameValue(Array.prototype.length, 0, 'The value of Array.prototype.length is expected to be 0'); diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js b/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js index f39d85ffb4..1e3ae76631 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js @@ -14,9 +14,11 @@ try { x.length = 4294967296; throw new Test262Error('#1.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length)); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#1.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#2 @@ -25,9 +27,11 @@ try { x.length = -1; throw new Test262Error('#2.1: x = []; x.length = -1 throw RangeError. Actual: x.length === ' + (x.length)); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#2.2: x = []; x.length = -1 throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#3 @@ -36,7 +40,9 @@ try { x.length = 1.5; throw new Test262Error('#3.1: x = []; x.length = 1.5 throw RangeError. Actual: x.length === ' + (x.length)); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#3.2: x = []; x.length = 1.5 throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js b/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js index e5b2f968ba..7d7e71c568 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js @@ -14,9 +14,11 @@ try { x.length = NaN; throw new Test262Error('#1.1: x = []; x.length = NaN throw RangeError. Actual: x.length === ' + (x.length)); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#1.2: x = []; x.length = NaN throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#2 @@ -25,9 +27,11 @@ try { x.length = Number.POSITIVE_INFINITY; throw new Test262Error('#2.1: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length)); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#2.2: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#3 @@ -36,9 +40,11 @@ try { x.length = Number.NEGATIVE_INFINITY; throw new Test262Error('#3.1: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length)); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#3.2: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } //CHECK#4 @@ -47,7 +53,9 @@ try { x.length = undefined; throw new Test262Error('#4.1: x = []; x.length = undefined throw RangeError. Actual: x.length === ' + (x.length)); } catch (e) { - if ((e instanceof RangeError) !== true) { - throw new Test262Error('#4.2: x = []; x.length = undefined throw RangeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof RangeError, + true, + 'The result of evaluating (e instanceof RangeError) is expected to be true' + ); } diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js b/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js index 3c79e9ae6a..46c7f97378 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js @@ -15,17 +15,9 @@ description: Change length of array //CHECK#1 var x = [0, , 2, , 4]; x.length = 4; -if (x[4] !== undefined) { - throw new Test262Error('#1: x = [0,,2,,4]; x.length = 4; x[4] === undefined. Actual: ' + (x[4])); -} +assert.sameValue(x[4], undefined, 'The value of x[4] is expected to equal undefined'); //CHECK#2 x.length = 3; -if (x[3] !== undefined) { - throw new Test262Error('#2: x = [0,,2,,4]; x.length = 4; x.length = 3; x[3] === undefined. Actual: ' + (x[3])); -} - -//CHECK#3 -if (x[2] !== 2) { - throw new Test262Error('#3: x = [0,,2,,4]; x.length = 4; x.length = 3; x[2] === 2. Actual: ' + (x[2])); -} +assert.sameValue(x[3], undefined, 'The value of x[3] is expected to equal undefined'); +assert.sameValue(x[2], 2, 'The value of x[2] is expected to be 2'); diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js b/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js index b0cf994de7..e42006bc92 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js @@ -16,12 +16,8 @@ description: Checking an inherited property Array.prototype[2] = 2; var x = [0, 1]; x.length = 3; -if (x.hasOwnProperty('2') !== false) { - throw new Test262Error('#1: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.hasOwnProperty(\'2\') === false. Actual: ' + (x.hasOwnProperty('2'))); -} +assert.sameValue(x.hasOwnProperty('2'), false, 'x.hasOwnProperty("2") must return false'); //CHECK#2 x.length = 2; -if (x[2] !== 2) { - throw new Test262Error('#2: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.length = 2; x[2] === 2. Actual: ' + (x[2])); -} +assert.sameValue(x[2], 2, 'The value of x[2] is expected to be 2'); diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.3_T1.js b/test/built-ins/Array/length/S15.4.5.1_A1.3_T1.js index 06a1201d73..b4dc799fe2 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.3_T1.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.3_T1.js @@ -11,41 +11,29 @@ description: length is object or primitve //CHECK#1 var x = []; x.length = true; -if (x.length !== 1) { - throw new Test262Error('#1: x = []; x.length = true; x.length === 1. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); //CHECK#2 x = [0]; x.length = null; -if (x.length !== 0) { - throw new Test262Error('#2: x = [0]; x.length = null; x.length === 0. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0'); //CHECK#3 x = [0]; x.length = new Boolean(false); -if (x.length !== 0) { - throw new Test262Error('#3: x = [0]; x.length = new Boolean(false); x.length === 0. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 0, 'The value of x.length is expected to be 0'); //CHECK#4 x = []; x.length = new Number(1); -if (x.length !== 1) { - throw new Test262Error('#4: x = []; x.length = new Number(1); x.length === 1. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); //CHECK#5 x = []; x.length = "1"; -if (x.length !== 1) { - throw new Test262Error('#5: x = []; x.length = "1"; x.length === 1. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); //CHECK#6 x = []; x.length = new String("1"); -if (x.length !== 1) { - throw new Test262Error('#6: x = []; x.length = new String("1"); x.length === 1. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js b/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js index 93d5c95e26..26261f2a19 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js @@ -15,9 +15,7 @@ x.length = { return 2 } }; -if (x.length !== 2) { - throw new Test262Error('#1: x = []; x.length = {valueOf: function() {return 2}}; x.length === 2. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2'); //CHECK#2 x = []; @@ -29,9 +27,7 @@ x.length = { return 1 } }; -if (x.length !== 2) { - throw new Test262Error('#0: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; x.length === 2. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2'); //CHECK#3 x = []; @@ -43,9 +39,7 @@ x.length = { return {} } }; -if (x.length !== 2) { - throw new Test262Error('#3: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return {}}}; x.length === 2. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2'); //CHECK#4 try { @@ -58,16 +52,10 @@ try { throw "error" } }; - if (x.length !== 2) { - throw new Test262Error('#4.1: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length === ",". Actual: ' + (x.length)); - } + assert.sameValue(x.length, 2, 'The value of x.length is expected to be 2'); } catch (e) { - if (e === "error") { - throw new Test262Error('#4.2: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length not throw "error"'); - } else { - throw new Test262Error('#4.3: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length not throw Error. Actual: ' + (e)); - } + assert.notSameValue(e, "error", 'The value of e is not "error"'); } //CHECK#5 @@ -77,9 +65,7 @@ x.length = { return 1 } }; -if (x.length !== 1) { - throw new Test262Error('#5: x = []; x.length = {toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); //CHECK#6 x = []; @@ -91,9 +77,7 @@ x.length = { return 1 } } -if (x.length !== 1) { - throw new Test262Error('#6: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length)); -} +assert.sameValue(x.length, 1, 'The value of x.length is expected to be 1'); //CHECK#7 try { @@ -110,9 +94,7 @@ try { throw new Test262Error('#7.1: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (x.length)); } catch (e) { - if (e !== "error") { - throw new Test262Error('#7.2: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (e)); - } + assert.sameValue(e, "error", 'The value of e is expected to be "error"'); } //CHECK#8 @@ -130,7 +112,9 @@ try { throw new Test262Error('#8.1: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (x.length)); } catch (e) { - if ((e instanceof TypeError) !== true) { - throw new Test262Error('#8.2: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (e)); - } + assert.sameValue( + e instanceof TypeError, + true, + 'The result of evaluating (e instanceof TypeError) is expected to be true' + ); } diff --git a/test/built-ins/Array/length/S15.4.5.2_A3_T4.js b/test/built-ins/Array/length/S15.4.5.2_A3_T4.js index b4f0411c9c..e9f5b8c40c 100644 --- a/test/built-ins/Array/length/S15.4.5.2_A3_T4.js +++ b/test/built-ins/Array/length/S15.4.5.2_A3_T4.js @@ -17,22 +17,7 @@ var x = [0, 1, 2]; x[4294967294] = 4294967294; x.length = 2; -//CHECK#1 -if (x[0] !== 0) { - throw new Test262Error('#1: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[0] === 0. Actual: ' + (x[0])); -} - -//CHECK#2 -if (x[1] !== 1) { - throw new Test262Error('#2: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[1] === 1. Actual: ' + (x[1])); -} - -//CHECK#3 -if (x[2] !== undefined) { - throw new Test262Error('#3: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[2] === undefined. Actual: ' + (x[2])); -} - -//CHECK#4 -if (x[4294967294] !== undefined) { - throw new Test262Error('#4: x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; x[4294967294] === undefined. Actual: ' + (x[4294967294])); -} +assert.sameValue(x[0], 0, 'The value of x[0] is expected to be 0'); +assert.sameValue(x[1], 1, 'The value of x[1] is expected to be 1'); +assert.sameValue(x[2], undefined, 'The value of x[2] is expected to equal undefined'); +assert.sameValue(x[4294967294], undefined, 'The value of x[4294967294] is expected to equal undefined'); diff --git a/test/built-ins/Array/length/define-own-prop-length-coercion-order-set.js b/test/built-ins/Array/length/define-own-prop-length-coercion-order-set.js index 0133117cec..c9c35dcb27 100644 --- a/test/built-ins/Array/length/define-own-prop-length-coercion-order-set.js +++ b/test/built-ins/Array/length/define-own-prop-length-coercion-order-set.js @@ -32,12 +32,15 @@ length[Symbol.toPrimitive] = function(hint) { assert.throws(TypeError, function() { "use strict"; array.length = length; -}); -assert.compareArray(hints, ["number", "number"]); +}, '`"use strict"; array.length = length` throws a TypeError exception'); +assert.compareArray(hints, ["number", "number"], 'The value of hints is expected to be ["number", "number"]'); array = [1, 2, 3]; hints = []; -assert(!Reflect.set(array, "length", length)); -assert.compareArray(hints, ["number", "number"]); +assert( + !Reflect.set(array, "length", length), + 'The value of !Reflect.set(array, "length", length) is expected to be true' +); +assert.compareArray(hints, ["number", "number"], 'The value of hints is expected to be ["number", "number"]'); diff --git a/test/built-ins/Array/length/define-own-prop-length-coercion-order.js b/test/built-ins/Array/length/define-own-prop-length-coercion-order.js index dccb456a26..5b471be372 100644 --- a/test/built-ins/Array/length/define-own-prop-length-coercion-order.js +++ b/test/built-ins/Array/length/define-own-prop-length-coercion-order.js @@ -47,12 +47,15 @@ var length = { assert.throws(TypeError, function() { Object.defineProperty(array, "length", {value: length, writable: true}); -}); -assert.sameValue(valueOfCalls, 2); +}, 'Object.defineProperty(array, "length", {value: length, writable: true}) throws a TypeError exception'); +assert.sameValue(valueOfCalls, 2, 'The value of valueOfCalls is expected to be 2'); array = [1, 2]; valueOfCalls = 0; -assert(!Reflect.defineProperty(array, "length", {value: length, writable: true})); -assert.sameValue(valueOfCalls, 2); +assert( + !Reflect.defineProperty(array, "length", {value: length, writable: true}), + 'The value of !Reflect.defineProperty(array, "length", {value: length, writable: true}) is expected to be true' +); +assert.sameValue(valueOfCalls, 2, 'The value of valueOfCalls is expected to be 2'); diff --git a/test/built-ins/Array/length/define-own-prop-length-no-value-order.js b/test/built-ins/Array/length/define-own-prop-length-no-value-order.js index b0f4835761..07538ecc29 100644 --- a/test/built-ins/Array/length/define-own-prop-length-no-value-order.js +++ b/test/built-ins/Array/length/define-own-prop-length-no-value-order.js @@ -35,9 +35,12 @@ features: [Reflect] assert.throws(TypeError, function() { Object.defineProperty([], "length", {configurable: true}); -}); +}, 'Object.defineProperty([], "length", {configurable: true}) throws a TypeError exception'); -assert(!Reflect.defineProperty([], "length", {enumerable: true})); +assert( + !Reflect.defineProperty([], "length", {enumerable: true}), + 'The value of !Reflect.defineProperty([], "length", {enumerable: true}) is expected to be true' +); assert.throws(TypeError, function() { Object.defineProperty([], "length", { @@ -45,12 +48,15 @@ assert.throws(TypeError, function() { throw new Test262Error("[[Get]] shouldn't be called"); }, }); -}); +}, 'Object.defineProperty([], "length", {get: function() {throw new Test262Error("[[Get]] shouldn"t be called");},}) throws a TypeError exception'); -assert(!Reflect.defineProperty([], "length", {set: function(_value) {}})); +assert( + !Reflect.defineProperty([], "length", {set: function(_value) {}}), + 'The value of !Reflect.defineProperty([], "length", {set: function(_value) {}}) is expected to be true' +); var array = []; Object.defineProperty(array, "length", {writable: false}); assert.throws(TypeError, function() { Object.defineProperty(array, "length", {writable: true}); -}); +}, 'Object.defineProperty(array, "length", {writable: true}) throws a TypeError exception'); diff --git a/test/built-ins/Array/length/define-own-prop-length-overflow-order.js b/test/built-ins/Array/length/define-own-prop-length-overflow-order.js index 1bd7df12a9..a9ba82069f 100644 --- a/test/built-ins/Array/length/define-own-prop-length-overflow-order.js +++ b/test/built-ins/Array/length/define-own-prop-length-overflow-order.js @@ -16,14 +16,14 @@ info: | assert.throws(RangeError, function() { Object.defineProperty([], "length", {value: -1, configurable: true}); -}); +}, 'Object.defineProperty([], "length", {value: -1, configurable: true}) throws a RangeError exception'); assert.throws(RangeError, function() { Object.defineProperty([], "length", {value: NaN, enumerable: true}); -}); +}, 'Object.defineProperty([], "length", {value: NaN, enumerable: true}) throws a RangeError exception'); var array = []; Object.defineProperty(array, "length", {writable: false}); assert.throws(RangeError, function() { Object.defineProperty(array, "length", {value: Number.MAX_SAFE_INTEGER, writable: true}); -}); +}, 'Object.defineProperty(array, "length", {value: Number.MAX_SAFE_INTEGER, writable: true}) throws a RangeError exception'); diff --git a/test/built-ins/Array/length/define-own-prop-length-overflow-realm.js b/test/built-ins/Array/length/define-own-prop-length-overflow-realm.js index 8b962629f3..cfa4216ca8 100644 --- a/test/built-ins/Array/length/define-own-prop-length-overflow-realm.js +++ b/test/built-ins/Array/length/define-own-prop-length-overflow-realm.js @@ -18,4 +18,4 @@ var array = new OArray(); assert.throws(RangeError, function() { array.length = 4294967296; -}); +}, 'array.length = 4294967296 throws a RangeError exception'); diff --git a/test/built-ins/Array/name.js b/test/built-ins/Array/name.js index 9960493ff1..1b56828736 100644 --- a/test/built-ins/Array/name.js +++ b/test/built-ins/Array/name.js @@ -21,7 +21,7 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.name, 'Array'); +assert.sameValue(Array.name, 'Array', 'The value of Array.name is expected to be "Array"'); verifyNotEnumerable(Array, 'name'); verifyNotWritable(Array, 'name'); diff --git a/test/built-ins/Array/of/construct-this-with-the-number-of-arguments.js b/test/built-ins/Array/of/construct-this-with-the-number-of-arguments.js index 1efa2fb4eb..ca13798fb1 100644 --- a/test/built-ins/Array/of/construct-this-with-the-number-of-arguments.js +++ b/test/built-ins/Array/of/construct-this-with-the-number-of-arguments.js @@ -24,16 +24,16 @@ function C(length) { } Array.of.call(C); -assert.sameValue(len, 0, '`Array.of.call(C);` called `new C(0)`'); -assert.sameValue(hits, 1, 'Called constructor once per call'); +assert.sameValue(len, 0, 'The value of len is expected to be 0'); +assert.sameValue(hits, 1, 'The value of hits is expected to be 1'); Array.of.call(C, 'a', 'b') -assert.sameValue(len, 2, '`Array.of.call(C, "a", "b"));` called `new C(2)`'); -assert.sameValue(hits, 2, 'Called constructor once per call'); +assert.sameValue(len, 2, 'The value of len is expected to be 2'); +assert.sameValue(hits, 2, 'The value of hits is expected to be 2'); Array.of.call(C, false, null, undefined); assert.sameValue( len, 3, - '`Array.of.call(C, false, null, undefined);` called `new C(3)`' + 'The value of len is expected to be 3' ); -assert.sameValue(hits, 3, 'Called constructor once per call'); +assert.sameValue(hits, 3, 'The value of hits is expected to be 3'); diff --git a/test/built-ins/Array/of/creates-a-new-array-from-arguments.js b/test/built-ins/Array/of/creates-a-new-array-from-arguments.js index fe0d495852..4c4d18b89c 100644 --- a/test/built-ins/Array/of/creates-a-new-array-from-arguments.js +++ b/test/built-ins/Array/of/creates-a-new-array-from-arguments.js @@ -25,21 +25,21 @@ info: | var a1 = Array.of('Mike', 'Rick', 'Leo'); assert.sameValue( a1.length, 3, - 'The new array length is the same as the arguments size' + 'The value of a1.length is expected to be 3' ); -assert.sameValue(a1[0], 'Mike', 'set each property in order - #1'); -assert.sameValue(a1[1], 'Rick', 'set each property in order - #2'); -assert.sameValue(a1[2], 'Leo', 'set each property in order - #3'); +assert.sameValue(a1[0], 'Mike', 'The value of a1[0] is expected to be "Mike"'); +assert.sameValue(a1[1], 'Rick', 'The value of a1[1] is expected to be "Rick"'); +assert.sameValue(a1[2], 'Leo', 'The value of a1[2] is expected to be "Leo"'); var a2 = Array.of(undefined, false, null, undefined); assert.sameValue( a2.length, 4, - 'Creates an array from the arguments, regarless of their type values' + 'The value of a2.length is expected to be 4' ); -assert.sameValue(a2[0], undefined, 'set each property in order - #1'); -assert.sameValue(a2[1], false, 'set each property in order - #2'); -assert.sameValue(a2[2], null, 'set each property in order - #3'); -assert.sameValue(a2[3], undefined, 'set each property in order - #4'); +assert.sameValue(a2[0], undefined, 'The value of a2[0] is expected to equal undefined'); +assert.sameValue(a2[1], false, 'The value of a2[1] is expected to be false'); +assert.sameValue(a2[2], null, 'The value of a2[2] is expected to be null'); +assert.sameValue(a2[3], undefined, 'The value of a2[3] is expected to equal undefined'); var a3 = Array.of(); -assert.sameValue(a3.length, 0, 'Array.of() returns an empty array'); +assert.sameValue(a3.length, 0, 'The value of a3.length is expected to be 0'); diff --git a/test/built-ins/Array/of/does-not-use-prototype-properties.js b/test/built-ins/Array/of/does-not-use-prototype-properties.js index 199ecd043a..42c270d4d3 100644 --- a/test/built-ins/Array/of/does-not-use-prototype-properties.js +++ b/test/built-ins/Array/of/does-not-use-prototype-properties.js @@ -16,7 +16,7 @@ Object.defineProperty(Array.prototype, "0", { }); var arr = Array.of(true); -assert.sameValue(arr[0], true); +assert.sameValue(arr[0], true, 'The value of arr[0] is expected to be true'); function Custom() {} @@ -27,4 +27,4 @@ Object.defineProperty(Custom.prototype, "0", { }); var custom = Array.of.call(Custom, true); -assert.sameValue(custom[0], true); +assert.sameValue(custom[0], true, 'The value of custom[0] is expected to be true'); diff --git a/test/built-ins/Array/of/length.js b/test/built-ins/Array/of/length.js index 2151f1060a..754d3e6729 100644 --- a/test/built-ins/Array/of/length.js +++ b/test/built-ins/Array/of/length.js @@ -13,7 +13,7 @@ includes: [propertyHelper.js] assert.sameValue( Array.of.length, 0, - 'The value of `Array.of.length` is `0`' + 'The value of Array.of.length is expected to be 0' ); verifyNotEnumerable(Array.of, 'length'); diff --git a/test/built-ins/Array/of/name.js b/test/built-ins/Array/of/name.js index 5c07646b44..1377a54097 100644 --- a/test/built-ins/Array/of/name.js +++ b/test/built-ins/Array/of/name.js @@ -14,7 +14,7 @@ includes: [propertyHelper.js] assert.sameValue( Array.of.name, 'of', - 'The value of `Array.of.name` is `"of"`' + 'The value of Array.of.name is expected to be "of"' ); verifyNotEnumerable(Array.of, 'name'); diff --git a/test/built-ins/Array/of/not-a-constructor.js b/test/built-ins/Array/of/not-a-constructor.js index fd725bb541..e79e3a76b0 100644 --- a/test/built-ins/Array/of/not-a-constructor.js +++ b/test/built-ins/Array/of/not-a-constructor.js @@ -25,5 +25,5 @@ assert.sameValue(isConstructor(Array.of), false, 'isConstructor(Array.of) must r assert.throws(TypeError, () => { new Array.of(1); -}, '`new Array.of(1)` throws TypeError'); +}, '`new Array.of(1)` throws a TypeError exception'); diff --git a/test/built-ins/Array/of/proto-from-ctor-realm.js b/test/built-ins/Array/of/proto-from-ctor-realm.js index 6fbe30e9d1..2ede8f4248 100644 --- a/test/built-ins/Array/of/proto-from-ctor-realm.js +++ b/test/built-ins/Array/of/proto-from-ctor-realm.js @@ -26,4 +26,8 @@ C.prototype = null; var a = Array.of.call(C, 1, 2, 3); -assert.sameValue(Object.getPrototypeOf(a), other.Object.prototype); +assert.sameValue( + Object.getPrototypeOf(a), + other.Object.prototype, + 'Object.getPrototypeOf(Array.of.call(C, 1, 2, 3)) returns other.Object.prototype' +); diff --git a/test/built-ins/Array/of/return-a-custom-instance.js b/test/built-ins/Array/of/return-a-custom-instance.js index a144677fca..5f2c8d78ad 100644 --- a/test/built-ins/Array/of/return-a-custom-instance.js +++ b/test/built-ins/Array/of/return-a-custom-instance.js @@ -20,18 +20,18 @@ var coop = Array.of.call(Coop, 'Mike', 'Rick', 'Leo'); assert.sameValue( coop.length, 3, - 'Sets a length property with the number of arguments' + 'The value of coop.length is expected to be 3' ); assert.sameValue( coop[0], 'Mike', - 'Sets each argument in order as integer properties - #1 argument' + 'The value of coop[0] is expected to be "Mike"' ); assert.sameValue( coop[1], 'Rick', - 'Sets each argument in order as integer properties - #2 argument' + 'The value of coop[1] is expected to be "Rick"' ); assert.sameValue( coop[2], 'Leo', - 'Sets each argument in order as integer properties - #3 argument' + 'The value of coop[2] is expected to be "Leo"' ); -assert(coop instanceof Coop, 'Returns an instance from a custom constructor'); +assert(coop instanceof Coop, 'The result of evaluating (coop instanceof Coop) is expected to be true'); diff --git a/test/built-ins/Array/of/return-a-new-array-object.js b/test/built-ins/Array/of/return-a-new-array-object.js index 12e9ba947d..0405dcfc2a 100644 --- a/test/built-ins/Array/of/return-a-new-array-object.js +++ b/test/built-ins/Array/of/return-a-new-array-object.js @@ -19,22 +19,22 @@ info: | ---*/ var result = Array.of(); -assert(result instanceof Array, 'Array.of() returns a new Array'); +assert(result instanceof Array, 'The result of evaluating (result instanceof Array) is expected to be true'); result = Array.of.call(undefined); assert( result instanceof Array, - 'this is not a constructor' + 'The result of evaluating (result instanceof Array) is expected to be true' ); result = Array.of.call(Math.cos); assert( result instanceof Array, - 'this is a builtin function with no [[Construct]] slot' + 'The result of evaluating (result instanceof Array) is expected to be true' ); result = Array.of.call(Math.cos.bind(Math)); assert( result instanceof Array, - 'this is a bound builtin function with no [[Construct]] slot' + 'The result of evaluating (result instanceof Array) is expected to be true' ); diff --git a/test/built-ins/Array/of/return-abrupt-from-contructor.js b/test/built-ins/Array/of/return-abrupt-from-contructor.js index de955442f5..0b5cd84e5c 100644 --- a/test/built-ins/Array/of/return-abrupt-from-contructor.js +++ b/test/built-ins/Array/of/return-abrupt-from-contructor.js @@ -24,4 +24,4 @@ function T() { assert.throws(Test262Error, function() { Array.of.call(T); -}); +}, 'Array.of.call(T) throws a Test262Error exception'); diff --git a/test/built-ins/Array/of/return-abrupt-from-data-property-using-proxy.js b/test/built-ins/Array/of/return-abrupt-from-data-property-using-proxy.js index 605741a1a0..774682a8db 100644 --- a/test/built-ins/Array/of/return-abrupt-from-data-property-using-proxy.js +++ b/test/built-ins/Array/of/return-abrupt-from-data-property-using-proxy.js @@ -35,4 +35,4 @@ function T() { assert.throws(Test262Error, function() { Array.of.call(T, 'Bob'); -}); +}, 'Array.of.call(T, "Bob") throws a Test262Error exception'); diff --git a/test/built-ins/Array/of/return-abrupt-from-data-property.js b/test/built-ins/Array/of/return-abrupt-from-data-property.js index 5822ef6fff..29c3bdc7be 100644 --- a/test/built-ins/Array/of/return-abrupt-from-data-property.js +++ b/test/built-ins/Array/of/return-abrupt-from-data-property.js @@ -31,7 +31,7 @@ function T1() { assert.throws(TypeError, function() { Array.of.call(T1, 'Bob'); -}); +}, 'Array.of.call(T1, "Bob") throws a TypeError exception'); function T2() { Object.defineProperty(this, 0, { @@ -43,4 +43,4 @@ function T2() { assert.throws(TypeError, function() { Array.of.call(T2, 'Bob'); -}) +}, 'Array.of.call(T2, "Bob") throws a TypeError exception') diff --git a/test/built-ins/Array/of/return-abrupt-from-setting-length.js b/test/built-ins/Array/of/return-abrupt-from-setting-length.js index 259bce34e6..282bd90182 100644 --- a/test/built-ins/Array/of/return-abrupt-from-setting-length.js +++ b/test/built-ins/Array/of/return-abrupt-from-setting-length.js @@ -23,4 +23,4 @@ function T() { assert.throws(Test262Error, function() { Array.of.call(T); -}); +}, 'Array.of.call(T) throws a Test262Error exception'); diff --git a/test/built-ins/Array/of/sets-length.js b/test/built-ins/Array/of/sets-length.js index 765ed93c78..48a7ca52e7 100644 --- a/test/built-ins/Array/of/sets-length.js +++ b/test/built-ins/Array/of/sets-length.js @@ -28,9 +28,9 @@ function Pack() { var result = Array.of.call(Pack, 'wolves', 'cards', 'cigarettes', 'lies'); -assert.sameValue(hits, 1, 'instance length setter called once'); +assert.sameValue(hits, 1, 'The value of hits is expected to be 1'); assert.sameValue( value, 4, - 'setter is called with the number of Array.of arguments' + 'The value of value is expected to be 4' ); -assert.sameValue(_this_, result, 'setter is called with the new object'); +assert.sameValue(_this_, result, 'The value of _this_ is expected to equal the value of result'); diff --git a/test/built-ins/Array/property-cast-boolean-primitive.js b/test/built-ins/Array/property-cast-boolean-primitive.js index fbe012c720..a721333370 100644 --- a/test/built-ins/Array/property-cast-boolean-primitive.js +++ b/test/built-ins/Array/property-cast-boolean-primitive.js @@ -12,9 +12,9 @@ description: Checking for boolean primitive var x = []; x[true] = 1; -assert.sameValue(x[1], undefined, "x[1]"); -assert.sameValue(x["true"], 1, "x['true']"); +assert.sameValue(x[1], undefined, 'The value of x[1] is expected to equal undefined'); +assert.sameValue(x["true"], 1, 'The value of x["true"] is expected to be 1'); x[false] = 0; -assert.sameValue(x[0], undefined, "x[0]"); -assert.sameValue(x["false"], 0, "x['false']") +assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined'); +assert.sameValue(x["false"], 0, 'The value of x["false"] is expected to be 0') diff --git a/test/built-ins/Array/property-cast-nan-infinity.js b/test/built-ins/Array/property-cast-nan-infinity.js index 6c1c57cbe1..f3734f854e 100644 --- a/test/built-ins/Array/property-cast-nan-infinity.js +++ b/test/built-ins/Array/property-cast-nan-infinity.js @@ -12,15 +12,15 @@ description: Checking for number primitive var x = []; x[NaN] = 1; -assert.sameValue(x[0], undefined, "x[NaN] does not cast to x[0]"); -assert.sameValue(x["NaN"], 1, "x[NaN] casts to x['NaN']"); +assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined'); +assert.sameValue(x["NaN"], 1, 'The value of x["NaN"] is expected to be 1'); var y = []; y[Number.POSITIVE_INFINITY] = 1; -assert.sameValue(y[0], undefined, "y[Number.POSITIVE_INFINITY] !== y[0]"); -assert.sameValue(y["Infinity"], 1, "y[Number.POSITIVE_INFINITY] === y['Infinity']"); +assert.sameValue(y[0], undefined, 'The value of y[0] is expected to equal undefined'); +assert.sameValue(y["Infinity"], 1, 'The value of y["Infinity"] is expected to be 1'); var z = []; z[Number.NEGATIVE_INFINITY] = 1; -assert.sameValue(z[0], undefined, "z[Number.NEGATIVE_INFINITY] !== z[0]"); -assert.sameValue(z["-Infinity"], 1, "z[Number.NEGATIVE_INFINITY] === z['-Infinity']"); +assert.sameValue(z[0], undefined, 'The value of z[0] is expected to equal undefined'); +assert.sameValue(z["-Infinity"], 1, 'The value of z["-Infinity"] is expected to be 1'); diff --git a/test/built-ins/Array/property-cast-number.js b/test/built-ins/Array/property-cast-number.js index 28cfa7e648..1ba77bd3b3 100644 --- a/test/built-ins/Array/property-cast-number.js +++ b/test/built-ins/Array/property-cast-number.js @@ -11,8 +11,8 @@ description: Checking for number primitive var x = []; x[4294967296] = 1; -assert.sameValue(x[0], undefined, "x[0]"); -assert.sameValue(x["4294967296"], 1, "x['4294967296'] !== 1"); +assert.sameValue(x[0], undefined, 'The value of x[0] is expected to equal undefined'); +assert.sameValue(x["4294967296"], 1, 'The value of x["4294967296"] is expected to be 1'); var y = []; y[4294967297] = 1; diff --git a/test/built-ins/Array/proto-from-ctor-realm-one.js b/test/built-ins/Array/proto-from-ctor-realm-one.js index 2289a98d4a..650dae54a4 100644 --- a/test/built-ins/Array/proto-from-ctor-realm-one.js +++ b/test/built-ins/Array/proto-from-ctor-realm-one.js @@ -31,24 +31,24 @@ var arr; newTarget.prototype = undefined; arr = Reflect.construct(Array, [1], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is undefined'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [1], newTarget)) returns other.Array.prototype'); newTarget.prototype = null; arr = Reflect.construct(Array, [1], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is null'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [1], newTarget)) returns other.Array.prototype'); newTarget.prototype = true; arr = Reflect.construct(Array, [1], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a Boolean'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [1], newTarget)) returns other.Array.prototype'); newTarget.prototype = ''; arr = Reflect.construct(Array, [1], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a String'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [1], newTarget)) returns other.Array.prototype'); newTarget.prototype = Symbol(); arr = Reflect.construct(Array, [1], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a Symbol'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [1], newTarget)) returns other.Array.prototype'); newTarget.prototype = 0; arr = Reflect.construct(Array, [1], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a Number'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [1], newTarget)) returns other.Array.prototype'); diff --git a/test/built-ins/Array/proto-from-ctor-realm-two.js b/test/built-ins/Array/proto-from-ctor-realm-two.js index 4df83c466e..2b58310e9f 100644 --- a/test/built-ins/Array/proto-from-ctor-realm-two.js +++ b/test/built-ins/Array/proto-from-ctor-realm-two.js @@ -31,24 +31,24 @@ var arr; newTarget.prototype = undefined; arr = Reflect.construct(Array, ['a', 'b'], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is undefined'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, ["a", "b"], newTarget)) returns other.Array.prototype'); newTarget.prototype = null; arr = Reflect.construct(Array, ['a', 'b'], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is null'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, ["a", "b"], newTarget)) returns other.Array.prototype'); newTarget.prototype = false; arr = Reflect.construct(Array, ['a', 'b'], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a Boolean'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, ["a", "b"], newTarget)) returns other.Array.prototype'); newTarget.prototype = ''; arr = Reflect.construct(Array, ['a', 'b'], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a String'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, ["a", "b"], newTarget)) returns other.Array.prototype'); newTarget.prototype = Symbol(); arr = Reflect.construct(Array, ['a', 'b'], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a Symbol'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, ["a", "b"], newTarget)) returns other.Array.prototype'); newTarget.prototype = -1; arr = Reflect.construct(Array, ['a', 'b'], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a Number'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, ["a", "b"], newTarget)) returns other.Array.prototype'); diff --git a/test/built-ins/Array/proto-from-ctor-realm-zero.js b/test/built-ins/Array/proto-from-ctor-realm-zero.js index 17419e0847..1673393e86 100644 --- a/test/built-ins/Array/proto-from-ctor-realm-zero.js +++ b/test/built-ins/Array/proto-from-ctor-realm-zero.js @@ -29,24 +29,24 @@ var arr; newTarget.prototype = undefined; arr = Reflect.construct(Array, [], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is undefined'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [], newTarget)) returns other.Array.prototype'); newTarget.prototype = null; arr = Reflect.construct(Array, [], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is null'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [], newTarget)) returns other.Array.prototype'); newTarget.prototype = true; arr = Reflect.construct(Array, [], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a Boolean'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [], newTarget)) returns other.Array.prototype'); newTarget.prototype = 'str'; arr = Reflect.construct(Array, [], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a String'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [], newTarget)) returns other.Array.prototype'); newTarget.prototype = Symbol(); arr = Reflect.construct(Array, [], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a Symbol'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [], newTarget)) returns other.Array.prototype'); newTarget.prototype = 1; arr = Reflect.construct(Array, [], newTarget); -assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'newTarget.prototype is a Number'); +assert.sameValue(Object.getPrototypeOf(arr), other.Array.prototype, 'Object.getPrototypeOf(Reflect.construct(Array, [], newTarget)) returns other.Array.prototype'); diff --git a/test/built-ins/Array/proto.js b/test/built-ins/Array/proto.js index 19ffcba3a8..faff2fc4c4 100644 --- a/test/built-ins/Array/proto.js +++ b/test/built-ins/Array/proto.js @@ -12,4 +12,8 @@ info: | intrinsic object %FunctionPrototype%. ---*/ -assert.sameValue(Object.getPrototypeOf(Array), Function.prototype); +assert.sameValue( + Object.getPrototypeOf(Array), + Function.prototype, + 'Object.getPrototypeOf(Array) returns Function.prototype' +); diff --git a/test/built-ins/Array/prototype/at/index-argument-tointeger.js b/test/built-ins/Array/prototype/at/index-argument-tointeger.js index f1f16aece0..6fd87d0c1c 100644 --- a/test/built-ins/Array/prototype/at/index-argument-tointeger.js +++ b/test/built-ins/Array/prototype/at/index-argument-tointeger.js @@ -11,7 +11,11 @@ info: | features: [Array.prototype.at] ---*/ -assert.sameValue(typeof Array.prototype.at, 'function'); +assert.sameValue( + typeof Array.prototype.at, + 'function', + 'The value of `typeof Array.prototype.at` is expected to be "function"' +); let valueOfCallCount = 0; let index = { @@ -24,4 +28,4 @@ let index = { let a = [0,1,2,3]; assert.sameValue(a.at(index), 1, 'a.at({valueOf() {valueOfCallCount++; return 1;}}) must return 1'); -assert.sameValue(valueOfCallCount, 1, 'The value of `valueOfCallCount` is 1'); +assert.sameValue(valueOfCallCount, 1, 'The value of valueOfCallCount is expected to be 1'); diff --git a/test/built-ins/Array/prototype/at/index-non-numeric-argument-tointeger-invalid.js b/test/built-ins/Array/prototype/at/index-non-numeric-argument-tointeger-invalid.js index bc379291ca..39c1c38667 100644 --- a/test/built-ins/Array/prototype/at/index-non-numeric-argument-tointeger-invalid.js +++ b/test/built-ins/Array/prototype/at/index-non-numeric-argument-tointeger-invalid.js @@ -11,10 +11,14 @@ info: | features: [Array.prototype.at] ---*/ -assert.sameValue(typeof Array.prototype.at, 'function'); +assert.sameValue( + typeof Array.prototype.at, + 'function', + 'The value of `typeof Array.prototype.at` is expected to be "function"' +); let a = [0,1,2,3]; assert.throws(TypeError, () => { a.at(Symbol()); -}, '`a.at(Symbol())` throws TypeError'); +}, 'a.at(Symbol()) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/at/index-non-numeric-argument-tointeger.js b/test/built-ins/Array/prototype/at/index-non-numeric-argument-tointeger.js index 9de0363826..a1dcf509d9 100644 --- a/test/built-ins/Array/prototype/at/index-non-numeric-argument-tointeger.js +++ b/test/built-ins/Array/prototype/at/index-non-numeric-argument-tointeger.js @@ -11,7 +11,11 @@ info: | features: [Array.prototype.at] ---*/ -assert.sameValue(typeof Array.prototype.at, 'function'); +assert.sameValue( + typeof Array.prototype.at, + 'function', + 'The value of `typeof Array.prototype.at` is expected to be "function"' +); let a = [0,1,2,3]; diff --git a/test/built-ins/Array/prototype/at/length.js b/test/built-ins/Array/prototype/at/length.js index 52b33f1307..417084d50e 100644 --- a/test/built-ins/Array/prototype/at/length.js +++ b/test/built-ins/Array/prototype/at/length.js @@ -12,11 +12,15 @@ info: | includes: [propertyHelper.js] features: [Array.prototype.at] ---*/ -assert.sameValue(typeof Array.prototype.at, 'function'); +assert.sameValue( + typeof Array.prototype.at, + 'function', + 'The value of `typeof Array.prototype.at` is expected to be "function"' +); assert.sameValue( Array.prototype.at.length, 1, - 'The value of Array.prototype.at.length is 1' + 'The value of Array.prototype.at.length is expected to be 1' ); verifyNotEnumerable(Array.prototype.at, 'length'); diff --git a/test/built-ins/Array/prototype/at/name.js b/test/built-ins/Array/prototype/at/name.js index 2995f60923..73569c7058 100644 --- a/test/built-ins/Array/prototype/at/name.js +++ b/test/built-ins/Array/prototype/at/name.js @@ -12,11 +12,15 @@ info: | includes: [propertyHelper.js] features: [Array.prototype.at] ---*/ -assert.sameValue(typeof Array.prototype.at, 'function'); +assert.sameValue( + typeof Array.prototype.at, + 'function', + 'The value of `typeof Array.prototype.at` is expected to be "function"' +); assert.sameValue( Array.prototype.at.name, 'at', - 'The value of Array.prototype.at.name is "at"' + 'The value of Array.prototype.at.name is expected to be "at"' ); verifyProperty(Array.prototype.at, 'name', { diff --git a/test/built-ins/Array/prototype/at/prop-desc.js b/test/built-ins/Array/prototype/at/prop-desc.js index 0a8ee5572d..d3aeba976d 100644 --- a/test/built-ins/Array/prototype/at/prop-desc.js +++ b/test/built-ins/Array/prototype/at/prop-desc.js @@ -11,12 +11,16 @@ info: | includes: [propertyHelper.js] features: [Array.prototype.at] ---*/ -assert.sameValue(typeof Array.prototype.at, 'function'); +assert.sameValue( + typeof Array.prototype.at, + 'function', + 'The value of `typeof Array.prototype.at` is expected to be "function"' +); assert.sameValue( typeof Array.prototype.at, 'function', - 'The value of `typeof Array.prototype.at` is "function"' + 'The value of `typeof Array.prototype.at` is expected to be "function"' ); verifyProperty(Array.prototype, 'at', { diff --git a/test/built-ins/Array/prototype/at/return-abrupt-from-this.js b/test/built-ins/Array/prototype/at/return-abrupt-from-this.js index 2613e751b8..abaef88437 100644 --- a/test/built-ins/Array/prototype/at/return-abrupt-from-this.js +++ b/test/built-ins/Array/prototype/at/return-abrupt-from-this.js @@ -11,12 +11,16 @@ info: | features: [Array.prototype.at] ---*/ -assert.sameValue(typeof Array.prototype.at, 'function'); +assert.sameValue( + typeof Array.prototype.at, + 'function', + 'The value of `typeof Array.prototype.at` is expected to be "function"' +); assert.throws(TypeError, () => { Array.prototype.at.call(undefined); -}, '`Array.prototype.at.call(undefined)` throws TypeError'); +}, 'Array.prototype.at.call(undefined) throws a TypeError exception'); assert.throws(TypeError, () => { Array.prototype.at.call(null); -}, '`Array.prototype.at.call(null)` throws TypeError'); +}, 'Array.prototype.at.call(null) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/at/returns-item-relative-index.js b/test/built-ins/Array/prototype/at/returns-item-relative-index.js index 0c252548f3..06151ffe66 100644 --- a/test/built-ins/Array/prototype/at/returns-item-relative-index.js +++ b/test/built-ins/Array/prototype/at/returns-item-relative-index.js @@ -19,12 +19,16 @@ info: | features: [Array.prototype.at] ---*/ -assert.sameValue(typeof Array.prototype.at, 'function'); +assert.sameValue( + typeof Array.prototype.at, + 'function', + 'The value of `typeof Array.prototype.at` is expected to be "function"' +); let a = [1, 2, 3, 4, ,5]; assert.sameValue(a.at(0), 1, 'a.at(0) must return 1'); assert.sameValue(a.at(-1), 5, 'a.at(-1) must return 5'); -assert.sameValue(a.at(-2), undefined, 'a.at(-2) must return undefined'); +assert.sameValue(a.at(-2), undefined, 'a.at(-2) returns undefined'); assert.sameValue(a.at(-3), 4, 'a.at(-3) must return 4'); assert.sameValue(a.at(-4), 3, 'a.at(-4) must return 3'); diff --git a/test/built-ins/Array/prototype/at/returns-item.js b/test/built-ins/Array/prototype/at/returns-item.js index f6bf36f7d9..6c5acfb9c2 100644 --- a/test/built-ins/Array/prototype/at/returns-item.js +++ b/test/built-ins/Array/prototype/at/returns-item.js @@ -19,7 +19,11 @@ info: | features: [Array.prototype.at] ---*/ -assert.sameValue(typeof Array.prototype.at, 'function'); +assert.sameValue( + typeof Array.prototype.at, + 'function', + 'The value of `typeof Array.prototype.at` is expected to be "function"' +); let a = [1, 2, 3, 4,,5]; @@ -27,5 +31,5 @@ assert.sameValue(a.at(0), 1, 'a.at(0) must return 1'); assert.sameValue(a.at(1), 2, 'a.at(1) must return 2'); assert.sameValue(a.at(2), 3, 'a.at(2) must return 3'); assert.sameValue(a.at(3), 4, 'a.at(3) must return 4'); -assert.sameValue(a.at(4), undefined, 'a.at(4) must return undefined'); +assert.sameValue(a.at(4), undefined, 'a.at(4) returns undefined'); assert.sameValue(a.at(5), 5, 'a.at(5) must return 5'); diff --git a/test/built-ins/Array/prototype/at/returns-undefined-for-holes-in-sparse-arrays.js b/test/built-ins/Array/prototype/at/returns-undefined-for-holes-in-sparse-arrays.js index 83578c1bc1..896d2b573d 100644 --- a/test/built-ins/Array/prototype/at/returns-undefined-for-holes-in-sparse-arrays.js +++ b/test/built-ins/Array/prototype/at/returns-undefined-for-holes-in-sparse-arrays.js @@ -22,22 +22,22 @@ features: [Array.prototype.at] assert.sameValue( typeof Array.prototype.at, 'function', - 'The value of `typeof Array.prototype.at` is "function"' + 'The value of `typeof Array.prototype.at` is expected to be "function"' ); let a = [0, 1, , 3, 4, , 6]; assert.sameValue(a.at(0), 0, 'a.at(0) must return 0'); assert.sameValue(a.at(1), 1, 'a.at(1) must return 1'); -assert.sameValue(a.at(2), undefined, 'a.at(2) must return undefined'); +assert.sameValue(a.at(2), undefined, 'a.at(2) returns undefined'); assert.sameValue(a.at(3), 3, 'a.at(3) must return 3'); assert.sameValue(a.at(4), 4, 'a.at(4) must return 4'); -assert.sameValue(a.at(5), undefined, 'a.at(5) must return undefined'); +assert.sameValue(a.at(5), undefined, 'a.at(5) returns undefined'); assert.sameValue(a.at(6), 6, 'a.at(6) must return 6'); assert.sameValue(a.at(-0), 0, 'a.at(-0) must return 0'); assert.sameValue(a.at(-1), 6, 'a.at(-1) must return 6'); -assert.sameValue(a.at(-2), undefined, 'a.at(-2) must return undefined'); +assert.sameValue(a.at(-2), undefined, 'a.at(-2) returns undefined'); assert.sameValue(a.at(-3), 4, 'a.at(-3) must return 4'); assert.sameValue(a.at(-4), 3, 'a.at(-4) must return 3'); -assert.sameValue(a.at(-5), undefined, 'a.at(-5) must return undefined'); +assert.sameValue(a.at(-5), undefined, 'a.at(-5) returns undefined'); assert.sameValue(a.at(-6), 1, 'a.at(-6) must return 1'); diff --git a/test/built-ins/Array/prototype/at/returns-undefined-for-out-of-range-index.js b/test/built-ins/Array/prototype/at/returns-undefined-for-out-of-range-index.js index f14c045b24..983f82131b 100644 --- a/test/built-ins/Array/prototype/at/returns-undefined-for-out-of-range-index.js +++ b/test/built-ins/Array/prototype/at/returns-undefined-for-out-of-range-index.js @@ -10,11 +10,15 @@ info: | If k < 0 or k ≥ len, then return undefined. features: [Array.prototype.at] ---*/ -assert.sameValue(typeof Array.prototype.at, 'function'); +assert.sameValue( + typeof Array.prototype.at, + 'function', + 'The value of `typeof Array.prototype.at` is expected to be "function"' +); let a = []; -assert.sameValue(a.at(-2), undefined, 'a.at(-2) must return undefined'); // wrap around the end -assert.sameValue(a.at(0), undefined, 'a.at(0) must return undefined'); -assert.sameValue(a.at(1), undefined, 'a.at(1) must return undefined'); +assert.sameValue(a.at(-2), undefined, 'a.at(-2) returns undefined'); // wrap around the end +assert.sameValue(a.at(0), undefined, 'a.at(0) returns undefined'); +assert.sameValue(a.at(1), undefined, 'a.at(1) returns undefined'); diff --git a/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js b/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js index 274d5b83b7..319cea0fe2 100644 --- a/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js +++ b/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js @@ -15,10 +15,13 @@ Object.defineProperty(Array.prototype, "0", { configurable: true }); -var newArr = Array.prototype.concat.call(101); +var newArrayFromConcat = Array.prototype.concat.call(101); -assert(newArr[0] instanceof Number); -verifyProperty(newArr, "0", { +assert( + newArrayFromConcat[0] instanceof Number, + 'The result of evaluating (newArrayFromConcat[0] instanceof Number) is expected to be true' +); +verifyProperty(newArrayFromConcat, "0", { writable: true, enumerable: true, configurable: true, diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-to-string-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-to-string-throws.js index c8e6a5d562..1915720abe 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-to-string-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-to-string-throws.js @@ -7,11 +7,10 @@ esid: sec-array.prototype.concat description: Array.prototype.concat array like length to string throws features: [Symbol.isConcatSpreadable] ---*/ -function MyError() {} -var obj = { +var objWithPoisonedLengthToString = { "length": { toString: function() { - throw new MyError(); + throw new Test262Error(); }, valueOf: null }, @@ -19,7 +18,7 @@ var obj = { "3": "B", "5": "C" }; -obj[Symbol.isConcatSpreadable] = true; -assert.throws(MyError, function() { - [].concat(obj); -}); +objWithPoisonedLengthToString[Symbol.isConcatSpreadable] = true; +assert.throws(Test262Error, function() { + [].concat(objWithPoisonedLengthToString); +}, '[].concat(objWithPoisonedLengthToString) throws a Test262Error exception'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-value-of-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-value-of-throws.js index 4ff54c415e..6e457ada74 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-value-of-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-length-value-of-throws.js @@ -7,11 +7,10 @@ esid: sec-array.prototype.concat description: Array.prototype.concat array like length valueOf throws features: [Symbol.isConcatSpreadable] ---*/ -function MyError() {} -var obj = { +var objWithPoisonedLengthValueOf = { "length": { valueOf: function() { - throw new MyError(); + throw new Test262Error(); }, toString: null }, @@ -19,7 +18,7 @@ var obj = { "3": "B", "5": "C" }; -obj[Symbol.isConcatSpreadable] = true; -assert.throws(MyError, function() { - [].concat(obj); -}); +objWithPoisonedLengthValueOf[Symbol.isConcatSpreadable] = true; +assert.throws(Test262Error, function() { + [].concat(objWithPoisonedLengthValueOf); +}, '[].concat(objWithPoisonedLengthValueOf) throws a Test262Error exception'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-negative-length.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-negative-length.js index 1e6cfb8dff..9f4ba09169 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-negative-length.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-negative-length.js @@ -15,8 +15,8 @@ var obj = { "5": "C" }; obj[Symbol.isConcatSpreadable] = true; -assert(compareArray([].concat(obj), [])); +assert.compareArray([].concat(obj), [], '[].concat({"length": -4294967294, "1": "A", "3": "B", "5": "C"}) must return []'); obj.length = -4294967294; -assert(compareArray([].concat(obj), [])); +assert.compareArray([].concat(obj), [], '[].concat({"length": -4294967294, "1": "A", "3": "B", "5": "C"}) must return []'); obj.length = "-4294967294"; -assert(compareArray([].concat(obj), [])); +assert.compareArray([].concat(obj), [], '[].concat({"length": -4294967294, "1": "A", "3": "B", "5": "C"}) must return []'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-primitive-non-number-length.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-primitive-non-number-length.js index cc4506710d..27a19e058d 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-primitive-non-number-length.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-primitive-non-number-length.js @@ -20,11 +20,11 @@ obj.length = { }, valueOf: null }; -assert(compareArray([].concat(obj), [])); +assert.compareArray([].concat(obj), [], '[].concat({"1": "A", "3": "B", "5": "C"}) must return []'); obj.length = { toString: null, valueOf: function() { return "SIX"; } }; -assert(compareArray([].concat(obj), [])); +assert.compareArray([].concat(obj), [], '[].concat({"1": "A", "3": "B", "5": "C"}) must return []'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-string-length.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-string-length.js index 6323bd8cdb..52401177df 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-string-length.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-string-length.js @@ -30,4 +30,4 @@ var expected = [ ]; var actual = Array.prototype.concat.call(obj, obj2, arr); -assert(compareArray(actual, expected)); +assert.compareArray(actual, expected, 'The value of actual is expected to equal the value of expected'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-to-length-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-to-length-throws.js index e5a440ca16..64effc7993 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-to-length-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like-to-length-throws.js @@ -7,7 +7,7 @@ esid: sec-array.prototype.concat description: Array.prototype.concat array like to length throws features: [Symbol.isConcatSpreadable] ---*/ -var obj = { +var spreadableWithBrokenLength = { "length": { valueOf: null, toString: null @@ -16,7 +16,7 @@ var obj = { "3": "B", "5": "C" }; -obj[Symbol.isConcatSpreadable] = true; +spreadableWithBrokenLength[Symbol.isConcatSpreadable] = true; var obj2 = { length: 3, "0": "0", @@ -25,5 +25,5 @@ var obj2 = { }; var arr = ["X", "Y", "Z"]; assert.throws(TypeError, function() { - Array.prototype.concat.call(obj, obj2, arr); -}); + Array.prototype.concat.call(spreadableWithBrokenLength, obj2, arr); +}, 'Array.prototype.concat.call(spreadableWithBrokenLength, obj2, arr) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like.js index 402f31c6cc..e8782cef10 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_array-like.js @@ -31,4 +31,4 @@ var expected = [ ]; var actual = Array.prototype.concat.call(obj, obj2, arr); -assert(compareArray(actual, expected)); +assert.compareArray(actual, expected, 'The value of actual is expected to equal the value of expected'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_holey-sloppy-arguments.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_holey-sloppy-arguments.js index 8e984e50aa..d4c562028f 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_holey-sloppy-arguments.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_holey-sloppy-arguments.js @@ -14,4 +14,6 @@ var args = (function(a) { })(1, 2, 3); delete args[1]; args[Symbol.isConcatSpreadable] = true; -assert(compareArray([1, void 0, 3, 1, void 0, 3], [].concat(args, args))); +assert.compareArray([1, void 0, 3, 1, void 0, 3], [].concat(args, args), + '[1, void 0, 3, 1, void 0, 3] must return the same value returned by [].concat(args, args)' +); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_large-typed-array.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_large-typed-array.js index 38419927b1..361a990748 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_large-typed-array.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_large-typed-array.js @@ -16,13 +16,22 @@ function concatTypedArray(type, elems, modulo) { ta_by_len[i] = items[i] = modulo === false ? i : elems % modulo; } var ta = new type(items); - assert(compareArray([].concat(ta, ta), [ta, ta])); + assert( + compareArray([].concat(ta, ta), [ta, ta]), + 'compareArray([].concat(ta, ta), [ta, ta]) must return true' + ); ta[Symbol.isConcatSpreadable] = true; - assert(compareArray([].concat(ta), items)); + assert.compareArray([].concat(ta), items, '[].concat(new type(items)) returns items'); - assert(compareArray([].concat(ta_by_len, ta_by_len), [ta_by_len, ta_by_len])); + assert( + compareArray([].concat(ta_by_len, ta_by_len), [ta_by_len, ta_by_len]), + 'compareArray([].concat(ta_by_len, ta_by_len), [ta_by_len, ta_by_len]) must return true' + ); ta_by_len[Symbol.isConcatSpreadable] = true; - assert(compareArray([].concat(ta_by_len), items)); + assert( + compareArray([].concat(ta_by_len), items), + 'compareArray([].concat(ta_by_len), items) must return true' + ); // TypedArray with fake `length`. ta = new type(1); @@ -34,7 +43,7 @@ function concatTypedArray(type, elems, modulo) { value: 4000 }); ta[Symbol.isConcatSpreadable] = true; - assert(compareArray([].concat(ta), expected)); + assert.compareArray([].concat(ta), expected, '[].concat(new type(1)) returns expected'); } var max = [Math.pow(2, 8), Math.pow(2, 16), Math.pow(2, 32), false, false]; diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_length-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_length-throws.js index eee6036f5a..63b65a2eb8 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_length-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_length-throws.js @@ -8,19 +8,18 @@ esid: sec-array.prototype.concat description: Array.prototype.concat length throws features: [Symbol.isConcatSpreadable] ---*/ -function MyError() {} -var obj = {}; -obj[Symbol.isConcatSpreadable] = true; -Object.defineProperty(obj, "length", { +var spreadablePoisonedLengthGetter = {}; +spreadablePoisonedLengthGetter[Symbol.isConcatSpreadable] = true; +Object.defineProperty(spreadablePoisonedLengthGetter, "length", { get: function() { - throw new MyError(); + throw new Test262Error(); } }); -assert.throws(MyError, function() { - [].concat(obj); -}); +assert.throws(Test262Error, function() { + [].concat(spreadablePoisonedLengthGetter); +}, '[].concat(spreadablePoisonedLengthGetter) throws a Test262Error exception'); -assert.throws(MyError, function() { - Array.prototype.concat.call(obj, 1, 2, 3); -}); +assert.throws(Test262Error, function() { + Array.prototype.concat.call(spreadablePoisonedLengthGetter, 1, 2, 3); +}, 'Array.prototype.concat.call(spreadablePoisonedLengthGetter, 1, 2, 3) throws a Test262Error exception'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_no-prototype.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_no-prototype.js index 81e8ee2698..1cd134348d 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_no-prototype.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_no-prototype.js @@ -7,4 +7,8 @@ esid: sec-array.prototype.concat description: Array.prototype.concat no prototype ---*/ -assert.sameValue(Array.prototype.concat.prototype, void 0); +assert.sameValue( + Array.prototype.concat.prototype, + void 0, + 'The value of Array.prototype.concat.prototype is expected to be void 0' +); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_non-array.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_non-array.js index edb905f1e1..f15bb55afc 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_non-array.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_non-array.js @@ -20,6 +20,10 @@ class NonArray { var obj = new NonArray(1, 2, 3); var result = Array.prototype.concat.call(obj, 4, 5, 6); -assert.sameValue(Array, result.constructor); -assert.sameValue(result instanceof NonArray, false); -assert(compareArray(result, [obj, 4, 5, 6])); +assert.sameValue(Array, result.constructor, 'The value of Array is expected to equal the value of result.constructor'); +assert.sameValue( + result instanceof NonArray, + false, + 'The result of evaluating (result instanceof NonArray) is expected to be false' +); +assert.compareArray(result, [obj, 4, 5, 6], 'The value of result is expected to be [obj, 4, 5, 6]'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-throws.js index f72b237e1d..192accf57c 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-throws.js @@ -8,16 +8,15 @@ esid: sec-array.prototype.concat description: Array.prototype.concat sloppy arguments throws features: [Symbol.isConcatSpreadable] ---*/ -function MyError() {} var args = (function(a) { return arguments; })(1, 2, 3); Object.defineProperty(args, 0, { get: function() { - throw new MyError(); + throw new Test262Error(); } }); args[Symbol.isConcatSpreadable] = true; -assert.throws(MyError, function() { +assert.throws(Test262Error, function() { return [].concat(args, args); -}); +}, 'return [].concat(args, args) throws a Test262Error exception'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-with-dupes.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-with-dupes.js index abdaed774f..6943e1b7a9 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-with-dupes.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments-with-dupes.js @@ -14,9 +14,13 @@ var args = (function(a, a, a) { return arguments; })(1, 2, 3); args[Symbol.isConcatSpreadable] = true; -assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3])); +assert.compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3], + '[].concat((function(a, a, a) {return arguments;})(1, 2, 3), (function(a, a, a) {return arguments;})(1, 2, 3)) must return [1, 2, 3, 1, 2, 3]' +); Object.defineProperty(args, "length", { value: 6 }); -assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0])); +assert.compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0], + '[].concat((function(a, a, a) {return arguments;})(1, 2, 3)) must return [1, 2, 3, void 0, void 0, void 0]' +); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments.js index 50af3bbe33..0303cd9a38 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_sloppy-arguments.js @@ -13,9 +13,13 @@ var args = (function(a, b, c) { return arguments; })(1, 2, 3); args[Symbol.isConcatSpreadable] = true; -assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3])); +assert.compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3], + '[].concat((function(a, b, c) {return arguments;})(1, 2, 3), (function(a, b, c) {return arguments;})(1, 2, 3)) must return [1, 2, 3, 1, 2, 3]' +); Object.defineProperty(args, "length", { value: 6 }); -assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0])); +assert.compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0], + '[].concat((function(a, b, c) {return arguments;})(1, 2, 3)) must return [1, 2, 3, void 0, void 0, void 0]' +); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_small-typed-array.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_small-typed-array.js index 64ded54db5..4c8763a9d9 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_small-typed-array.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_small-typed-array.js @@ -16,13 +16,22 @@ function concatTypedArray(type, elems, modulo) { ta_by_len[i] = items[i] = modulo === false ? i : elems % modulo; } var ta = new type(items); - assert(compareArray([].concat(ta, ta), [ta, ta])); + assert( + compareArray([].concat(ta, ta), [ta, ta]), + 'compareArray([].concat(ta, ta), [ta, ta]) must return true' + ); ta[Symbol.isConcatSpreadable] = true; - assert(compareArray([].concat(ta), items)); + assert.compareArray([].concat(ta), items, '[].concat(new type(items)) returns items'); - assert(compareArray([].concat(ta_by_len, ta_by_len), [ta_by_len, ta_by_len])); + assert( + compareArray([].concat(ta_by_len, ta_by_len), [ta_by_len, ta_by_len]), + 'compareArray([].concat(ta_by_len, ta_by_len), [ta_by_len, ta_by_len]) must return true' + ); ta_by_len[Symbol.isConcatSpreadable] = true; - assert(compareArray([].concat(ta_by_len), items)); + assert( + compareArray([].concat(ta_by_len), items), + 'compareArray([].concat(ta_by_len), items) must return true' + ); // TypedArray with fake `length`. ta = new type(1); @@ -34,7 +43,7 @@ function concatTypedArray(type, elems, modulo) { value: 4000 }); ta[Symbol.isConcatSpreadable] = true; - assert(compareArray([].concat(ta), expected)); + assert.compareArray([].concat(ta), expected, '[].concat(new type(1)) returns expected'); } var max = [Math.pow(2, 8), Math.pow(2, 16), Math.pow(2, 32), false, false]; [ diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-boolean-wrapper.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-boolean-wrapper.js index 83c3b9a6ae..b754142a62 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-boolean-wrapper.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-boolean-wrapper.js @@ -11,25 +11,31 @@ features: [Symbol.isConcatSpreadable] ---*/ var bool = new Boolean(true) // Boolean wrapper objects are not concat-spreadable by default -assert(compareArray([bool], [].concat(bool))); +assert.compareArray([bool], [].concat(bool), '[bool] must return the same value returned by [].concat(bool)'); // Boolean wrapper objects may be individually concat-spreadable bool[Symbol.isConcatSpreadable] = true; bool.length = 3; bool[0] = 1, bool[1] = 2, bool[2] = 3; -assert(compareArray([1, 2, 3], [].concat(bool))); +assert.compareArray([1, 2, 3], [].concat(bool), + '[1, 2, 3] must return the same value returned by [].concat(bool)' +); Boolean.prototype[Symbol.isConcatSpreadable] = true; // Boolean wrapper objects may be concat-spreadable -assert(compareArray([], [].concat(new Boolean(true)))); +assert.compareArray([], [].concat(new Boolean(true)), + '[] must return the same value returned by [].concat(new Boolean(true))' +); Boolean.prototype[0] = 1; Boolean.prototype[1] = 2; Boolean.prototype[2] = 3; Boolean.prototype.length = 3; -assert(compareArray([1, 2, 3], [].concat(new Boolean(true)))); +assert.compareArray([1, 2, 3], [].concat(new Boolean(true)), + '[1, 2, 3] must return the same value returned by [].concat(new Boolean(true))' +); // Boolean values are never concat-spreadable -assert(compareArray([true], [].concat(true))); +assert.compareArray([true], [].concat(true), '[true] must return the same value returned by [].concat(true)'); delete Boolean.prototype[Symbol.isConcatSpreadable]; delete Boolean.prototype[0]; delete Boolean.prototype[1]; diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-function.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-function.js index 78a55f41e3..e40d44b477 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-function.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-function.js @@ -11,20 +11,24 @@ features: [Symbol.isConcatSpreadable] ---*/ var fn = function(a, b, c) {} // Functions are not concat-spreadable by default -assert(compareArray([fn], [].concat(fn))); +assert.compareArray([fn], [].concat(fn), '[fn] must return the same value returned by [].concat(fn)'); // Functions may be individually concat-spreadable fn[Symbol.isConcatSpreadable] = true; fn[0] = 1, fn[1] = 2, fn[2] = 3; -assert(compareArray([1, 2, 3], [].concat(fn))); +assert.compareArray([1, 2, 3], [].concat(fn), '[1, 2, 3] must return the same value returned by [].concat(fn)'); Function.prototype[Symbol.isConcatSpreadable] = true; // Functions may be concat-spreadable -assert(compareArray([void 0, void 0, void 0], [].concat(function(a, b, c) {}))); +assert.compareArray([void 0, void 0, void 0], [].concat(function(a, b, c) {}), + '[void 0, void 0, void 0] must return the same value returned by [].concat(function(a, b, c) {})' +); Function.prototype[0] = 1; Function.prototype[1] = 2; Function.prototype[2] = 3; -assert(compareArray([1, 2, 3], [].concat(function(a, b, c) {}))); +assert.compareArray([1, 2, 3], [].concat(function(a, b, c) {}), + '[1, 2, 3] must return the same value returned by [].concat(function(a, b, c) {})' +); delete Function.prototype[Symbol.isConcatSpreadable]; delete Function.prototype[0]; diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-getter-throws.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-getter-throws.js index 38462cbe5a..971732f6e0 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-getter-throws.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-getter-throws.js @@ -8,18 +8,17 @@ esid: sec-array.prototype.concat description: Array.prototype.concat Symbol.isConcatSpreadable getter throws features: [Symbol.isConcatSpreadable] ---*/ -function MyError() {} -var obj = {}; -Object.defineProperty(obj, Symbol.isConcatSpreadable, { +var spreadablePoisonedGetter = {}; +Object.defineProperty(spreadablePoisonedGetter, Symbol.isConcatSpreadable, { get: function() { - throw new MyError(); + throw new Test262Error(); } }); -assert.throws(MyError, function() { - [].concat(obj); -}); +assert.throws(Test262Error, function() { + [].concat(spreadablePoisonedGetter); +}, '[].concat(spreadablePoisonedGetter) throws a Test262Error exception'); -assert.throws(MyError, function() { - Array.prototype.concat.call(obj, 1, 2, 3); -}); +assert.throws(Test262Error, function() { + Array.prototype.concat.call(spreadablePoisonedGetter, 1, 2, 3); +}, 'Array.prototype.concat.call(spreadablePoisonedGetter, 1, 2, 3) throws a Test262Error exception'); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-number-wrapper.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-number-wrapper.js index 540de0f36a..62bac94563 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-number-wrapper.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-number-wrapper.js @@ -11,25 +11,29 @@ features: [Symbol.isConcatSpreadable] ---*/ var num = new Number(true) // Number wrapper objects are not concat-spreadable by default -assert(compareArray([num], [].concat(num))); +assert.compareArray([num], [].concat(num), '[num] must return the same value returned by [].concat(num)'); // Number wrapper objects may be individually concat-spreadable num[Symbol.isConcatSpreadable] = true; num.length = 3; num[0] = 1, num[1] = 2, num[2] = 3; -assert(compareArray([1, 2, 3], [].concat(num))); +assert.compareArray([1, 2, 3], [].concat(num), '[1, 2, 3] must return the same value returned by [].concat(num)'); Number.prototype[Symbol.isConcatSpreadable] = true; // Number wrapper objects may be concat-spreadable -assert(compareArray([], [].concat(new Number(123)))); +assert.compareArray([], [].concat(new Number(123)), + '[] must return the same value returned by [].concat(new Number(123))' +); Number.prototype[0] = 1; Number.prototype[1] = 2; Number.prototype[2] = 3; Number.prototype.length = 3; -assert(compareArray([1, 2, 3], [].concat(new Number(123)))); +assert.compareArray([1, 2, 3], [].concat(new Number(123)), + '[1, 2, 3] must return the same value returned by [].concat(new Number(123))' +); // Number values are never concat-spreadable -assert(compareArray([true], [].concat(true))); +assert.compareArray([true], [].concat(true), '[true] must return the same value returned by [].concat(true)'); delete Number.prototype[Symbol.isConcatSpreadable]; delete Number.prototype[0]; delete Number.prototype[1]; diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-reg-exp.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-reg-exp.js index e399fb389d..7c610ae90a 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-reg-exp.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-reg-exp.js @@ -11,22 +11,26 @@ features: [Symbol.isConcatSpreadable] ---*/ var re = /abc/; // RegExps are not concat-spreadable by default -assert(compareArray([].concat(re), [re])); +assert.compareArray([].concat(re), [re], '[].concat(/abc/) must return [re]'); // RegExps may be individually concat-spreadable re[Symbol.isConcatSpreadable] = true; re[0] = 1, re[1] = 2, re[2] = 3, re.length = 3; -assert(compareArray([].concat(re), [1, 2, 3])); +assert.compareArray([].concat(re), [1, 2, 3], '[].concat(/abc/) must return [1, 2, 3]'); // RegExps may be concat-spreadable RegExp.prototype[Symbol.isConcatSpreadable] = true; RegExp.prototype.length = 3; -assert(compareArray([].concat(/abc/), [void 0, void 0, void 0])); +assert.compareArray([].concat(/abc/), [void 0, void 0, void 0], + '[].concat(/abc/) must return [void 0, void 0, void 0]' +); RegExp.prototype[0] = 1; RegExp.prototype[1] = 2; RegExp.prototype[2] = 3; -assert(compareArray([].concat(/abc/), [1, 2, 3])); +assert.compareArray([].concat(/abc/), [1, 2, 3], + '[].concat(/abc/) must return [1, 2, 3]' +); delete RegExp.prototype[Symbol.isConcatSpreadable]; delete RegExp.prototype[0]; diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-sparse-object.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-sparse-object.js index 6afe99d2e3..5666a9e0f1 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-sparse-object.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-sparse-object.js @@ -13,7 +13,11 @@ var obj = { length: 5 }; obj[Symbol.isConcatSpreadable] = true; -assert(compareArray([void 0, void 0, void 0, void 0, void 0], [].concat(obj))); +assert.compareArray([void 0, void 0, void 0, void 0, void 0], [].concat(obj), + '[void 0, void 0, void 0, void 0, void 0] must return the same value returned by [].concat(obj)' +); obj.length = 4000; -assert(compareArray(new Array(4000), [].concat(obj))); +assert.compareArray(new Array(4000), [].concat(obj), + 'new Array(4000) must return the same value returned by [].concat(obj)' +); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-string-wrapper.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-string-wrapper.js index 9e44307da9..9b20089ef9 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-string-wrapper.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_spreadable-string-wrapper.js @@ -11,16 +11,22 @@ features: [Symbol.isConcatSpreadable] ---*/ var str1 = new String("yuck\uD83D\uDCA9") // String wrapper objects are not concat-spreadable by default -assert(compareArray([str1], [].concat(str1))); +assert.compareArray([str1], [].concat(str1), '[str1] must return the same value returned by [].concat(str1)'); // String wrapper objects may be individually concat-spreadable str1[Symbol.isConcatSpreadable] = true; -assert(compareArray(["y", "u", "c", "k", "\uD83D", "\uDCA9"], [].concat(str1))); +assert.compareArray(["y", "u", "c", "k", "\uD83D", "\uDCA9"], [].concat(str1), + '["y", "u", "c", "k", "uD83D", "uDCA9"] must return the same value returned by [].concat(str1)' +); String.prototype[Symbol.isConcatSpreadable] = true; // String wrapper objects may be concat-spreadable -assert(compareArray(["y", "u", "c", "k", "\uD83D", "\uDCA9"], [].concat(new String("yuck\uD83D\uDCA9")))); +assert.compareArray(["y", "u", "c", "k", "\uD83D", "\uDCA9"], [].concat(new String("yuck\uD83D\uDCA9")), + '["y", "u", "c", "k", "uD83D", "uDCA9"] must return the same value returned by [].concat(new String("yuckuD83DuDCA9"))' +); // String values are never concat-spreadable -assert(compareArray(["yuck\uD83D\uDCA9"], [].concat("yuck\uD83D\uDCA9"))); +assert.compareArray(["yuck\uD83D\uDCA9"], [].concat("yuck\uD83D\uDCA9"), + '["yuckuD83DuDCA9"] must return the same value returned by [].concat("yuckuD83DuDCA9")' +); delete String.prototype[Symbol.isConcatSpreadable]; diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_strict-arguments.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_strict-arguments.js index 16683f7a81..8e5da8060f 100644 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_strict-arguments.js +++ b/test/built-ins/Array/prototype/concat/Array.prototype.concat_strict-arguments.js @@ -14,9 +14,13 @@ var args = (function(a, b, c) { return arguments; })(1, 2, 3); args[Symbol.isConcatSpreadable] = true; -assert(compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3])); +assert.compareArray([].concat(args, args), [1, 2, 3, 1, 2, 3], + '[].concat("(function(a, b, c) {"use strict"; return arguments;})(1, 2, 3)", "(function(a, b, c) {"use strict"; return arguments;})(1, 2, 3)") must return [1, 2, 3, 1, 2, 3]' +); Object.defineProperty(args, "length", { value: 6 }); -assert(compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0])); +assert.compareArray([].concat(args), [1, 2, 3, void 0, void 0, void 0], + '[].concat("(function(a, b, c) {"use strict"; return arguments;})(1, 2, 3)") must return [1, 2, 3, void 0, void 0, void 0]' +); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T1.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T1.js index 585e048439..c1f617cace 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T1.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T1.js @@ -18,36 +18,10 @@ var arr = x.concat(y, z); //CHECK#0 arr.getClass = Object.prototype.toString; -if (arr.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#0: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr is Array object. Actual: ' + (arr.getClass())); -} - -//CHECK#1 -if (arr[0] !== 0) { - throw new Test262Error('#1: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[0] === 0. Actual: ' + (arr[0])); -} - -//CHECK#2 -if (arr[1] !== 1) { - throw new Test262Error('#2: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[1] === 1. Actual: ' + (arr[1])); -} - -//CHECK#3 -if (arr[2] !== 2) { - throw new Test262Error('#3: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[2] === 2. Actual: ' + (arr[2])); -} - -//CHECK#4 -if (arr[3] !== 3) { - throw new Test262Error('#4: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[3] === 3. Actual: ' + (arr[3])); -} - -//CHECK#5 -if (arr[4] !== 4) { - throw new Test262Error('#5: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[4] === 4. Actual: ' + (arr[4])); -} - -//CHECK#6 -if (arr.length !== 5) { - throw new Test262Error('#6: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr.length === 5. Actual: ' + (arr.length)); -} +assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"'); +assert.sameValue(arr[0], 0, 'The value of arr[0] is expected to be 0'); +assert.sameValue(arr[1], 1, 'The value of arr[1] is expected to be 1'); +assert.sameValue(arr[2], 2, 'The value of arr[2] is expected to be 2'); +assert.sameValue(arr[3], 3, 'The value of arr[3] is expected to be 3'); +assert.sameValue(arr[4], 4, 'The value of arr[4] is expected to be 4'); +assert.sameValue(arr.length, 5, 'The value of arr.length is expected to be 5'); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T2.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T2.js index a425e98283..3a095865ef 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T2.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T2.js @@ -18,46 +18,12 @@ var arr = x.concat(y, z, -1, true, "NaN"); //CHECK#0 arr.getClass = Object.prototype.toString; -if (arr.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#0: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr is Array object. Actual: ' + (arr.getClass())); -} - -//CHECK#1 -if (arr[0] !== 0) { - throw new Test262Error('#1: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[0] === 0. Actual: ' + (arr[0])); -} - -//CHECK#2 -if (arr[1] !== y) { - throw new Test262Error('#2: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[1] === y. Actual: ' + (arr[1])); -} - -//CHECK#3 -if (arr[2] !== 1) { - throw new Test262Error('#3: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[2] === 1. Actual: ' + (arr[2])); -} - -//CHECK#4 -if (arr[3] !== 2) { - throw new Test262Error('#4: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[3] === 2. Actual: ' + (arr[3])); -} - -//CHECK#5 -if (arr[4] !== -1) { - throw new Test262Error('#5: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[4] === -1. Actual: ' + (arr[4])); -} - -//CHECK#6 -if (arr[5] !== true) { - throw new Test262Error('#6: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[5] === true. Actual: ' + (arr[5])); -} - -//CHECK#7 -if (arr[6] !== "NaN") { - throw new Test262Error('#7: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[6] === "NaN". Actual: ' + (arr[6])); -} - -//CHECK#8 -if (arr.length !== 7) { - throw new Test262Error('#8: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr.length === 7. Actual: ' + (arr.length)); -} +assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"'); +assert.sameValue(arr[0], 0, 'The value of arr[0] is expected to be 0'); +assert.sameValue(arr[1], y, 'The value of arr[1] is expected to equal the value of y'); +assert.sameValue(arr[2], 1, 'The value of arr[2] is expected to be 1'); +assert.sameValue(arr[3], 2, 'The value of arr[3] is expected to be 2'); +assert.sameValue(arr[4], -1, 'The value of arr[4] is expected to be -1'); +assert.sameValue(arr[5], true, 'The value of arr[5] is expected to be true'); +assert.sameValue(arr[6], "NaN", 'The value of arr[6] is expected to be "NaN"'); +assert.sameValue(arr.length, 7, 'The value of arr.length is expected to be 7'); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T3.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T3.js index 08c6d5e62a..5331193a6c 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T3.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T3.js @@ -16,26 +16,8 @@ var arr = x.concat(); //CHECK#0 arr.getClass = Object.prototype.toString; -if (arr.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#0: var x = [0,1]; var arr = x.concat(); arr is Array object. Actual: ' + (arr.getClass())); -} - -//CHECK#1 -if (arr[0] !== 0) { - throw new Test262Error('#1: var x = [0,1]; var arr = x.concat(); arr[0] === 0. Actual: ' + (arr[0])); -} - -//CHECK#2 -if (arr[1] !== 1) { - throw new Test262Error('#2: var x = [0,1]; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1])); -} - -//CHECK#3 -if (arr.length !== 2) { - throw new Test262Error('#3: var x = [0,1]; var arr = x.concat(); arr.length === 2. Actual: ' + (arr.length)); -} - -//CHECK#4 -if (arr === x) { - throw new Test262Error('#4: var x = [0,1]; var arr = x.concat(); arr !== x'); -} +assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"'); +assert.sameValue(arr[0], 0, 'The value of arr[0] is expected to be 0'); +assert.sameValue(arr[1], 1, 'The value of arr[1] is expected to be 1'); +assert.sameValue(arr.length, 2, 'The value of arr.length is expected to be 2'); +assert.notSameValue(arr, x, 'The value of arr is expected to not equal the value of `x`'); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T4.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T4.js index 4700fbe871..082cc4a236 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T4.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A1_T4.js @@ -16,26 +16,8 @@ var arr = x.concat([], [, ]); //CHECK#0 arr.getClass = Object.prototype.toString; -if (arr.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#0: var x = [,1]; var arr = x.concat([], [,]); arr is Array object. Actual: ' + (arr.getClass())); -} - -//CHECK#1 -if (arr[0] !== undefined) { - throw new Test262Error('#1: var x = [,1]; var arr = x.concat([], [,]); arr[0] === undefined. Actual: ' + (arr[0])); -} - -//CHECK#2 -if (arr[1] !== 1) { - throw new Test262Error('#2: var x = [,1]; var arr = x.concat([], [,]); arr[1] === 1. Actual: ' + (arr[1])); -} - -//CHECK#2 -if (arr[2] !== undefined) { - throw new Test262Error('#2: var x = [,1]; var arr = x.concat([], [,]); arr[2] === undefined. Actual: ' + (arr[2])); -} - -//CHECK#4 -if (arr.length !== 3) { - throw new Test262Error('#4: var x = [,1]; var arr = x.concat([], [,]); arr.length === 3. Actual: ' + (arr.length)); -} +assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"'); +assert.sameValue(arr[0], undefined, 'The value of arr[0] is expected to equal undefined'); +assert.sameValue(arr[1], 1, 'The value of arr[1] is expected to be 1'); +assert.sameValue(arr[2], undefined, 'The value of arr[2] is expected to equal undefined'); +assert.sameValue(arr.length, 3, 'The value of arr.length is expected to be 3'); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T1.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T1.js index 5f4ae0e313..aedd191070 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T1.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T1.js @@ -18,46 +18,12 @@ var arr = x.concat(y, z, -1, true, "NaN"); //CHECK#0 arr.getClass = Object.prototype.toString; -if (arr.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#0: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr is Array object. Actual: ' + (arr.getClass())); -} - -//CHECK#1 -if (arr[0] !== x) { - throw new Test262Error('#1: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[0] === x. Actual: ' + (arr[0])); -} - -//CHECK#2 -if (arr[1] !== y) { - throw new Test262Error('#2: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[1] === y. Actual: ' + (arr[1])); -} - -//CHECK#3 -if (arr[2] !== 1) { - throw new Test262Error('#3: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[2] === 1. Actual: ' + (arr[2])); -} - -//CHECK#4 -if (arr[3] !== 2) { - throw new Test262Error('#4: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[3] === 2. Actual: ' + (arr[3])); -} - -//CHECK#5 -if (arr[4] !== -1) { - throw new Test262Error('#5: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[4] === -1. Actual: ' + (arr[4])); -} - -//CHECK#6 -if (arr[5] !== true) { - throw new Test262Error('#6: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[5] === true. Actual: ' + (arr[5])); -} - -//CHECK#7 -if (arr[6] !== "NaN") { - throw new Test262Error('#7: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[6] === "NaN". Actual: ' + (arr[6])); -} - -//CHECK#8 -if (arr.length !== 7) { - throw new Test262Error('#8: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr.length === 7. Actual: ' + (arr.length)); -} +assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"'); +assert.sameValue(arr[0], x, 'The value of arr[0] is expected to equal the value of x'); +assert.sameValue(arr[1], y, 'The value of arr[1] is expected to equal the value of y'); +assert.sameValue(arr[2], 1, 'The value of arr[2] is expected to be 1'); +assert.sameValue(arr[3], 2, 'The value of arr[3] is expected to be 2'); +assert.sameValue(arr[4], -1, 'The value of arr[4] is expected to be -1'); +assert.sameValue(arr[5], true, 'The value of arr[5] is expected to be true'); +assert.sameValue(arr[6], "NaN", 'The value of arr[6] is expected to be "NaN"'); +assert.sameValue(arr.length, 7, 'The value of arr.length is expected to be 7'); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T2.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T2.js index 73f05eda8a..3d172ac6ed 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T2.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A2_T2.js @@ -16,16 +16,6 @@ var arr = x.concat(); //CHECK#0 arr.getClass = Object.prototype.toString; -if (arr.getClass() !== "[object " + "Array" + "]") { - throw new Test262Error('#0: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat() arr is Array object. Actual: ' + (arr.getClass())); -} - -//CHECK#1 -if (arr[0] !== x) { - throw new Test262Error('#1: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat(); arr[0] === x. Actual: ' + (arr[0])); -} - -//CHECK#2 -if (arr.length !== 1) { - throw new Test262Error('#2: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat(); arr.length === 1. Actual: ' + (arr.length)); -} +assert.sameValue(arr.getClass(), "[object Array]", 'arr.getClass() must return "[object Array]"'); +assert.sameValue(arr[0], x, 'The value of arr[0] is expected to equal the value of x'); +assert.sameValue(arr.length, 1, 'The value of arr.length is expected to be 1'); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T1.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T1.js index 81ba10d44e..b07baf3387 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T1.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T1.js @@ -15,20 +15,9 @@ var x = [0]; x.length = 2; var arr = x.concat(); -//CHECK#1 -if (arr[0] !== 0) { - throw new Test262Error('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr[0] === 0. Actual: ' + (arr[0])); -} - -//CHECK#2 -if (arr[1] !== 1) { - throw new Test262Error('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1])); -} - -//CHECK#3 -if (arr.hasOwnProperty('1') !== true) { - throw new Test262Error('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr.hasOwnProperty(\'1\') === true. Actual: ' + (arr.hasOwnProperty('1'))); -} +assert.sameValue(arr[0], 0, 'The value of arr[0] is expected to be 0'); +assert.sameValue(arr[1], 1, 'The value of arr[1] is expected to be 1'); +assert.sameValue(arr.hasOwnProperty('1'), true, 'arr.hasOwnProperty("1") must return true'); Object.prototype[1] = 1; Object.prototype.length = 2; @@ -38,17 +27,6 @@ x = { }; var arr = x.concat(); -//CHECK#4 -if (arr[0] !== x) { - throw new Test262Error('#4: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr[0] === x. Actual: ' + (arr[0])); -} - -//CHECK#5 -if (arr[1] !== 1) { - throw new Test262Error('#5: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1])); -} - -//CHECK#6 -if (arr.hasOwnProperty('1') !== false) { - throw new Test262Error('#6: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr.hasOwnProperty(\'1\') === false. Actual: ' + (arr.hasOwnProperty('1'))); -} +assert.sameValue(arr[0], x, 'The value of arr[0] is expected to equal the value of x'); +assert.sameValue(arr[1], 1, 'The value of arr[1] is expected to be 1'); +assert.sameValue(arr.hasOwnProperty('1'), false, 'arr.hasOwnProperty("1") must return false'); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T2.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T2.js index fd975863c8..e274c05984 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T2.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T2.js @@ -11,54 +11,25 @@ description: > var a = [0]; -if (a.length !== 1) { - throw new Test262Error("expected a.length === 1, actually " + a.length); -} +assert.sameValue(a.length, 1, 'The value of a.length is expected to be 1'); a.length = 3; -if (a[1] !== undefined) { - throw new Test262Error("expected a[1] === undefined, actually " + a[1]); -} -if (a[2] !== undefined) { - throw new Test262Error("expected a[2] === undefined, actually " + a[2]); -} +assert.sameValue(a[1], undefined, 'The value of a[1] is expected to equal undefined'); +assert.sameValue(a[2], undefined, 'The value of a[2] is expected to equal undefined'); Array.prototype[2] = 2; -if (a[1] !== undefined) { - throw new Test262Error("expected a[1] === undefined, actually " + a[1]); -} -if (a[2] !== 2) { - throw new Test262Error("expected a[2] === 2, actually " + a[2]); -} - -if (a.hasOwnProperty('1') !== false) { - throw new Test262Error("a.hasOwnProperty('1') === false, actually " + a.hasOwnProperty('1')); -} -if (a.hasOwnProperty('2') !== false) { - throw new Test262Error("a.hasOwnProperty('2') === false, actually " + a.hasOwnProperty('2')); -} +assert.sameValue(a[1], undefined, 'The value of a[1] is expected to equal undefined'); +assert.sameValue(a[2], 2, 'The value of a[2] is expected to be 2'); +assert.sameValue(a.hasOwnProperty('1'), false, 'a.hasOwnProperty("1") must return false'); +assert.sameValue(a.hasOwnProperty('2'), false, 'a.hasOwnProperty("2") must return false'); var b = a.concat(); -if (b.length !== 3) { - throw new Test262Error("expected b.length === 3, actually " + b.length); -} - -if (b[0] !== 0) { - throw new Test262Error("expected b[0] === 0, actually " + b[0]); -} -if (b[1] !== undefined) { - throw new Test262Error("expected b[1] === undefined, actually " + b[1]); -} -if (b[2] !== 2) { - throw new Test262Error("expected b[2] === 2, actually " + b[2]); -} - -if (b.hasOwnProperty('1') !== false) { - throw new Test262Error("expected b.hasOwnProperty('1') === false, actually " + b.hasOwnProperty('1')); -} -if (b.hasOwnProperty('2') !== true) { - throw new Test262Error("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2')); -} +assert.sameValue(b.length, 3, 'The value of b.length is expected to be 3'); +assert.sameValue(b[0], 0, 'The value of b[0] is expected to be 0'); +assert.sameValue(b[1], undefined, 'The value of b[1] is expected to equal undefined'); +assert.sameValue(b[2], 2, 'The value of b[2] is expected to be 2'); +assert.sameValue(b.hasOwnProperty('1'), false, 'b.hasOwnProperty("1") must return false'); +assert.sameValue(b.hasOwnProperty('2'), true, 'b.hasOwnProperty("2") must return true'); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T3.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T3.js index 75f0f99aba..12d6525839 100644 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T3.js +++ b/test/built-ins/Array/prototype/concat/S15.4.4.4_A3_T3.js @@ -11,54 +11,25 @@ description: > var a = [0]; -if (a.length !== 1) { - throw new Test262Error("expected a.length === 1, actually " + a.length); -} +assert.sameValue(a.length, 1, 'The value of a.length is expected to be 1'); a.length = 3; -if (a[1] !== undefined) { - throw new Test262Error("expected a[1] === undefined, actually " + a[1]); -} -if (a[2] !== undefined) { - throw new Test262Error("expected a[2] === undefined, actually " + a[2]); -} +assert.sameValue(a[1], undefined, 'The value of a[1] is expected to equal undefined'); +assert.sameValue(a[2], undefined, 'The value of a[2] is expected to equal undefined'); Object.prototype[2] = 2; -if (a[1] !== undefined) { - throw new Test262Error("expected a[1] === undefined, actually " + a[1]); -} -if (a[2] !== 2) { - throw new Test262Error("expected a[2] === 2, actually " + a[2]); -} - -if (a.hasOwnProperty('1') !== false) { - throw new Test262Error("a.hasOwnProperty('1') === false, actually " + a.hasOwnProperty('1')); -} -if (a.hasOwnProperty('2') !== false) { - throw new Test262Error("a.hasOwnProperty('2') === false, actually " + a.hasOwnProperty('2')); -} +assert.sameValue(a[1], undefined, 'The value of a[1] is expected to equal undefined'); +assert.sameValue(a[2], 2, 'The value of a[2] is expected to be 2'); +assert.sameValue(a.hasOwnProperty('1'), false, 'a.hasOwnProperty("1") must return false'); +assert.sameValue(a.hasOwnProperty('2'), false, 'a.hasOwnProperty("2") must return false'); var b = a.concat(); -if (b.length !== 3) { - throw new Test262Error("expected b.length === 3, actually " + b.length); -} - -if (b[0] !== 0) { - throw new Test262Error("expected b[0] === 0, actually " + b[0]); -} -if (b[1] !== undefined) { - throw new Test262Error("expected b[1] === undefined, actually " + b[1]); -} -if (b[2] !== 2) { - throw new Test262Error("expected b[2] === 2, actually " + b[2]); -} - -if (b.hasOwnProperty('1') !== false) { - throw new Test262Error("expected b.hasOwnProperty('1') === false, actually " + b.hasOwnProperty('1')); -} -if (b.hasOwnProperty('2') !== true) { - throw new Test262Error("expected b.hasOwnProperty('2') === true, actually " + b.hasOwnProperty('2')); -} +assert.sameValue(b.length, 3, 'The value of b.length is expected to be 3'); +assert.sameValue(b[0], 0, 'The value of b[0] is expected to be 0'); +assert.sameValue(b[1], undefined, 'The value of b[1] is expected to equal undefined'); +assert.sameValue(b[2], 2, 'The value of b[2] is expected to be 2'); +assert.sameValue(b.hasOwnProperty('1'), false, 'b.hasOwnProperty("1") must return false'); +assert.sameValue(b.hasOwnProperty('2'), true, 'b.hasOwnProperty("2") must return true'); diff --git a/test/built-ins/Array/prototype/concat/arg-length-exceeding-integer-limit.js b/test/built-ins/Array/prototype/concat/arg-length-exceeding-integer-limit.js index 6c0f56b9a1..814259b3ed 100644 --- a/test/built-ins/Array/prototype/concat/arg-length-exceeding-integer-limit.js +++ b/test/built-ins/Array/prototype/concat/arg-length-exceeding-integer-limit.js @@ -19,15 +19,15 @@ info: | features: [Symbol.isConcatSpreadable, Proxy] ---*/ -var spreadable = {}; -spreadable.length = Number.MAX_SAFE_INTEGER; -spreadable[Symbol.isConcatSpreadable] = true; +var spreadableLengthOutOfRange = {}; +spreadableLengthOutOfRange.length = Number.MAX_SAFE_INTEGER; +spreadableLengthOutOfRange[Symbol.isConcatSpreadable] = true; assert.throws(TypeError, function() { - [1].concat(spreadable); -}); + [1].concat(spreadableLengthOutOfRange); +}, '[1].concat(spreadableLengthOutOfRange) throws a TypeError exception'); -var proxy = new Proxy([], { +var proxyForArrayWithLengthOutOfRange = new Proxy([], { get: function(_target, key) { if (key === "length") { return Number.MAX_SAFE_INTEGER; @@ -36,5 +36,5 @@ var proxy = new Proxy([], { }); assert.throws(TypeError, function() { - [].concat(1, proxy); -}); + [].concat(1, proxyForArrayWithLengthOutOfRange); +}, '[].concat(1, proxyForArrayWithLengthOutOfRange) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/arg-length-near-integer-limit.js b/test/built-ins/Array/prototype/concat/arg-length-near-integer-limit.js index 9321c5a139..9c6e154229 100644 --- a/test/built-ins/Array/prototype/concat/arg-length-near-integer-limit.js +++ b/test/built-ins/Array/prototype/concat/arg-length-near-integer-limit.js @@ -24,14 +24,14 @@ info: | features: [Symbol.isConcatSpreadable] ---*/ -var spreadable = { +var spreadableHasPoisonedIndex = { length: Number.MAX_SAFE_INTEGER, get 0() { throw new Test262Error(); }, }; -spreadable[Symbol.isConcatSpreadable] = true; +spreadableHasPoisonedIndex[Symbol.isConcatSpreadable] = true; assert.throws(Test262Error, function() { - [].concat(spreadable); -}); + [].concat(spreadableHasPoisonedIndex); +}, '[].concat(spreadableHasPoisonedIndex) throws a Test262Error exception'); diff --git a/test/built-ins/Array/prototype/concat/call-with-boolean.js b/test/built-ins/Array/prototype/concat/call-with-boolean.js index 9e4fe4a8a2..6165d185b1 100644 --- a/test/built-ins/Array/prototype/concat/call-with-boolean.js +++ b/test/built-ins/Array/prototype/concat/call-with-boolean.js @@ -9,10 +9,10 @@ description: Array.prototype.concat applied to boolean primitive assert.sameValue( Array.prototype.concat.call(true)[0] instanceof Boolean, true, - 'The result of `(Array.prototype.concat.call(true)[0] instanceof Boolean)` is true' + 'The result of evaluating (Array.prototype.concat.call(true)[0] instanceof Boolean) is expected to be true' ); assert.sameValue( Array.prototype.concat.call(false)[0] instanceof Boolean, true, - 'The result of `(Array.prototype.concat.call(false)[0] instanceof Boolean)` is true' + 'The result of evaluating (Array.prototype.concat.call(false)[0] instanceof Boolean) is expected to be true' ); diff --git a/test/built-ins/Array/prototype/concat/create-ctor-non-object.js b/test/built-ins/Array/prototype/concat/create-ctor-non-object.js index e1570411c8..19b56ba825 100644 --- a/test/built-ins/Array/prototype/concat/create-ctor-non-object.js +++ b/test/built-ins/Array/prototype/concat/create-ctor-non-object.js @@ -21,22 +21,22 @@ var a = []; a.constructor = null; assert.throws(TypeError, function() { a.concat(); -}, 'null value'); +}, 'a.concat() throws a TypeError exception'); a = []; a.constructor = 1; assert.throws(TypeError, function() { a.concat(); -}, 'number value'); +}, 'a.concat() throws a TypeError exception'); a = []; a.constructor = 'string'; assert.throws(TypeError, function() { a.concat(); -}, 'string value'); +}, 'a.concat() throws a TypeError exception'); a = []; a.constructor = true; assert.throws(TypeError, function() { a.concat(); -}, 'boolean value'); +}, 'a.concat() throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/create-ctor-poisoned.js b/test/built-ins/Array/prototype/concat/create-ctor-poisoned.js index d8a87ab249..63599b9d2d 100644 --- a/test/built-ins/Array/prototype/concat/create-ctor-poisoned.js +++ b/test/built-ins/Array/prototype/concat/create-ctor-poisoned.js @@ -23,4 +23,4 @@ Object.defineProperty(a, 'constructor', { assert.throws(Test262Error, function() { a.concat(); -}); +}, 'a.concat() throws a Test262Error exception'); diff --git a/test/built-ins/Array/prototype/concat/create-non-array.js b/test/built-ins/Array/prototype/concat/create-non-array.js index dfb8f18f16..0a4765e69e 100644 --- a/test/built-ins/Array/prototype/concat/create-non-array.js +++ b/test/built-ins/Array/prototype/concat/create-non-array.js @@ -27,8 +27,12 @@ Object.defineProperty(obj, 'constructor', { result = Array.prototype.concat.call(obj); -assert.sameValue(callCount, 0, '`constructor` property not accessed'); -assert.sameValue(Object.getPrototypeOf(result), Array.prototype); -assert(Array.isArray(result), 'result is an Array exotic object'); -assert.sameValue(result.length, 1, 'array created with appropriate length'); -assert.sameValue(result[0], obj); +assert.sameValue(callCount, 0, 'The value of callCount is expected to be 0'); +assert.sameValue( + Object.getPrototypeOf(result), + Array.prototype, + 'Object.getPrototypeOf(Array.prototype.concat.call(obj)) returns Array.prototype' +); +assert(Array.isArray(result), 'Array.isArray(result) must return true'); +assert.sameValue(result.length, 1, 'The value of result.length is expected to be 1'); +assert.sameValue(result[0], obj, 'The value of result[0] is expected to equal the value of obj'); diff --git a/test/built-ins/Array/prototype/concat/create-proto-from-ctor-realm-array.js b/test/built-ins/Array/prototype/concat/create-proto-from-ctor-realm-array.js index 6a9ddc9b6b..fc9915ae1a 100644 --- a/test/built-ins/Array/prototype/concat/create-proto-from-ctor-realm-array.js +++ b/test/built-ins/Array/prototype/concat/create-proto-from-ctor-realm-array.js @@ -38,5 +38,9 @@ Object.defineProperty(OArray, Symbol.species, speciesDesc); result = array.concat(); -assert.sameValue(Object.getPrototypeOf(result), Array.prototype); -assert.sameValue(callCount, 0, 'Species constructor is not referenced'); +assert.sameValue( + Object.getPrototypeOf(result), + Array.prototype, + 'Object.getPrototypeOf(array.concat()) returns Array.prototype' +); +assert.sameValue(callCount, 0, 'The value of callCount is expected to be 0'); diff --git a/test/built-ins/Array/prototype/concat/create-proto-from-ctor-realm-non-array.js b/test/built-ins/Array/prototype/concat/create-proto-from-ctor-realm-non-array.js index e3aef0fd8c..002a606941 100644 --- a/test/built-ins/Array/prototype/concat/create-proto-from-ctor-realm-non-array.js +++ b/test/built-ins/Array/prototype/concat/create-proto-from-ctor-realm-non-array.js @@ -39,5 +39,9 @@ Object.defineProperty(Array, Symbol.species, speciesDesc); result = array.concat(); -assert.sameValue(Object.getPrototypeOf(result), CustomCtor.prototype); -assert.sameValue(callCount, 0, 'Array species constructor is not referenced'); +assert.sameValue( + Object.getPrototypeOf(result), + CustomCtor.prototype, + 'Object.getPrototypeOf(array.concat()) returns CustomCtor.prototype' +); +assert.sameValue(callCount, 0, 'The value of callCount is expected to be 0'); diff --git a/test/built-ins/Array/prototype/concat/create-proxy.js b/test/built-ins/Array/prototype/concat/create-proxy.js index 93e1d57e78..9475ddc2b5 100644 --- a/test/built-ins/Array/prototype/concat/create-proxy.js +++ b/test/built-ins/Array/prototype/concat/create-proxy.js @@ -36,4 +36,8 @@ array.constructor[Symbol.species] = Ctor; result = Array.prototype.concat.call(proxy); -assert.sameValue(Object.getPrototypeOf(result), Ctor.prototype); +assert.sameValue( + Object.getPrototypeOf(result), + Ctor.prototype, + 'Object.getPrototypeOf(Array.prototype.concat.call(proxy)) returns Ctor.prototype' +); diff --git a/test/built-ins/Array/prototype/concat/create-revoked-proxy.js b/test/built-ins/Array/prototype/concat/create-revoked-proxy.js index d7a09b7c7f..4fd0716526 100644 --- a/test/built-ins/Array/prototype/concat/create-revoked-proxy.js +++ b/test/built-ins/Array/prototype/concat/create-revoked-proxy.js @@ -33,6 +33,6 @@ o.revoke(); assert.throws(TypeError, function() { Array.prototype.concat.call(o.proxy); -}); +}, 'Array.prototype.concat.call(o.proxy) throws a TypeError exception'); -assert.sameValue(callCount, 0, '`constructor` property not accessed'); +assert.sameValue(callCount, 0, 'The value of callCount is expected to be 0'); diff --git a/test/built-ins/Array/prototype/concat/create-species-abrupt.js b/test/built-ins/Array/prototype/concat/create-species-abrupt.js index bd5649983b..cf7fc3de80 100644 --- a/test/built-ins/Array/prototype/concat/create-species-abrupt.js +++ b/test/built-ins/Array/prototype/concat/create-species-abrupt.js @@ -29,4 +29,4 @@ a.constructor[Symbol.species] = Ctor; assert.throws(Test262Error, function() { a.concat(); -}); +}, 'a.concat() throws a Test262Error exception'); diff --git a/test/built-ins/Array/prototype/concat/create-species-non-ctor.js b/test/built-ins/Array/prototype/concat/create-species-non-ctor.js index 00ff522d06..1095078be4 100644 --- a/test/built-ins/Array/prototype/concat/create-species-non-ctor.js +++ b/test/built-ins/Array/prototype/concat/create-species-non-ctor.js @@ -28,4 +28,4 @@ a.constructor[Symbol.species] = parseInt; assert.throws(TypeError, function() { a.concat(); -}); +}, 'a.concat() throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/create-species-non-extensible-spreadable.js b/test/built-ins/Array/prototype/concat/create-species-non-extensible-spreadable.js index 1565025e40..3fb74440fe 100644 --- a/test/built-ins/Array/prototype/concat/create-species-non-extensible-spreadable.js +++ b/test/built-ins/Array/prototype/concat/create-species-non-extensible-spreadable.js @@ -40,4 +40,4 @@ arr.constructor[Symbol.species] = A; assert.throws(TypeError, function() { arr.concat([1]); -}); +}, 'arr.concat([1]) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/create-species-non-extensible.js b/test/built-ins/Array/prototype/concat/create-species-non-extensible.js index ce69c532ef..5ee7bba247 100644 --- a/test/built-ins/Array/prototype/concat/create-species-non-extensible.js +++ b/test/built-ins/Array/prototype/concat/create-species-non-extensible.js @@ -38,4 +38,4 @@ arr.constructor[Symbol.species] = A; assert.throws(TypeError, function() { arr.concat(1); -}); +}, 'arr.concat(1) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/create-species-null.js b/test/built-ins/Array/prototype/concat/create-species-null.js index a53bee3331..ab7cbdbe6e 100644 --- a/test/built-ins/Array/prototype/concat/create-species-null.js +++ b/test/built-ins/Array/prototype/concat/create-species-null.js @@ -28,5 +28,9 @@ a.constructor[Symbol.species] = null; result = a.concat(); -assert.sameValue(Object.getPrototypeOf(result), Array.prototype); -assert(Array.isArray(result), 'result is an Array exotic object'); +assert.sameValue( + Object.getPrototypeOf(result), + Array.prototype, + 'Object.getPrototypeOf(a.concat()) returns Array.prototype' +); +assert(Array.isArray(result), 'Array.isArray(result) must return true'); diff --git a/test/built-ins/Array/prototype/concat/create-species-poisoned.js b/test/built-ins/Array/prototype/concat/create-species-poisoned.js index 174ee3dfe5..aecbe9a2f6 100644 --- a/test/built-ins/Array/prototype/concat/create-species-poisoned.js +++ b/test/built-ins/Array/prototype/concat/create-species-poisoned.js @@ -28,4 +28,4 @@ Object.defineProperty(a.constructor, Symbol.species, { assert.throws(Test262Error, function() { a.concat(); -}); +}, 'a.concat() throws a Test262Error exception'); diff --git a/test/built-ins/Array/prototype/concat/create-species-undef.js b/test/built-ins/Array/prototype/concat/create-species-undef.js index 129945ae00..dda56e5b25 100644 --- a/test/built-ins/Array/prototype/concat/create-species-undef.js +++ b/test/built-ins/Array/prototype/concat/create-species-undef.js @@ -30,5 +30,9 @@ a.constructor[Symbol.species] = undefined; result = a.concat(); -assert.sameValue(Object.getPrototypeOf(result), Array.prototype); -assert(Array.isArray(result), 'result is an Array exotic object'); +assert.sameValue( + Object.getPrototypeOf(result), + Array.prototype, + 'Object.getPrototypeOf(a.concat()) returns Array.prototype' +); +assert(Array.isArray(result), 'Array.isArray(result) must return true'); diff --git a/test/built-ins/Array/prototype/concat/create-species-with-non-configurable-property-spreadable.js b/test/built-ins/Array/prototype/concat/create-species-with-non-configurable-property-spreadable.js index 6ae665eca5..f86e16f2c2 100644 --- a/test/built-ins/Array/prototype/concat/create-species-with-non-configurable-property-spreadable.js +++ b/test/built-ins/Array/prototype/concat/create-species-with-non-configurable-property-spreadable.js @@ -42,4 +42,4 @@ arr.constructor[Symbol.species] = A; assert.throws(TypeError, function() { arr.concat([1]); -}); +}, 'arr.concat([1]) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/create-species-with-non-configurable-property.js b/test/built-ins/Array/prototype/concat/create-species-with-non-configurable-property.js index bf3eb73b5f..cb2b5fda16 100644 --- a/test/built-ins/Array/prototype/concat/create-species-with-non-configurable-property.js +++ b/test/built-ins/Array/prototype/concat/create-species-with-non-configurable-property.js @@ -40,4 +40,4 @@ arr.constructor[Symbol.species] = A; assert.throws(TypeError, function() { arr.concat(1); -}); +}, 'arr.concat(1) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/create-species.js b/test/built-ins/Array/prototype/concat/create-species.js index 9ca5eb58db..ebf182af92 100644 --- a/test/built-ins/Array/prototype/concat/create-species.js +++ b/test/built-ins/Array/prototype/concat/create-species.js @@ -35,8 +35,12 @@ a.constructor[Symbol.species] = Ctor; result = a.concat(); -assert.sameValue(callCount, 1, 'Constructor invoked exactly once'); -assert.sameValue(Object.getPrototypeOf(thisValue), Ctor.prototype); -assert.sameValue(args.length, 1, 'Constructor invoked with a single argument'); -assert.sameValue(args[0], 0); -assert.sameValue(result, instance); +assert.sameValue(callCount, 1, 'The value of callCount is expected to be 1'); +assert.sameValue( + Object.getPrototypeOf(thisValue), + Ctor.prototype, + 'Object.getPrototypeOf(this) returns Ctor.prototype' +); +assert.sameValue(args.length, 1, 'The value of args.length is expected to be 1'); +assert.sameValue(args[0], 0, 'The value of args[0] is expected to be 0'); +assert.sameValue(result, instance, 'The value of result is expected to equal the value of instance'); diff --git a/test/built-ins/Array/prototype/concat/is-concat-spreadable-get-err.js b/test/built-ins/Array/prototype/concat/is-concat-spreadable-get-err.js index ab9b4c4be3..7c189f4c04 100644 --- a/test/built-ins/Array/prototype/concat/is-concat-spreadable-get-err.js +++ b/test/built-ins/Array/prototype/concat/is-concat-spreadable-get-err.js @@ -35,4 +35,4 @@ Object.defineProperty(o, Symbol.isConcatSpreadable, { assert.throws(Test262Error, function() { Array.prototype.concat.call(o); -}); +}, 'Array.prototype.concat.call(o) throws a Test262Error exception'); diff --git a/test/built-ins/Array/prototype/concat/is-concat-spreadable-get-order.js b/test/built-ins/Array/prototype/concat/is-concat-spreadable-get-order.js index 012857565d..18926738ad 100644 --- a/test/built-ins/Array/prototype/concat/is-concat-spreadable-get-order.js +++ b/test/built-ins/Array/prototype/concat/is-concat-spreadable-get-order.js @@ -51,8 +51,12 @@ var arr1 = []; Object.defineProperty(arr1, "constructor", descConstructor); Object.defineProperty(arr1, Symbol.isConcatSpreadable, descSpreadable); -assert.compareArray(arr1.concat(1), [1]); -assert.compareArray(calls, ["constructor", "isConcatSpreadable"]); +assert.compareArray(arr1.concat(1), [1], 'arr1.concat(1) must return [1]'); +assert.compareArray( + calls, + ["constructor", "isConcatSpreadable"], + 'The value of calls is expected to be ["constructor", "isConcatSpreadable"]' +); calls = []; @@ -61,5 +65,9 @@ var arg = {}; Object.defineProperty(arr2, "constructor", descConstructor); Object.defineProperty(arg, Symbol.isConcatSpreadable, descSpreadable); -assert.compareArray(arr2.concat(arg), [arg]); -assert.compareArray(calls, ["constructor", "isConcatSpreadable"]); +assert.compareArray(arr2.concat(arg), [arg], 'arr2.concat({}) must return [arg]'); +assert.compareArray( + calls, + ["constructor", "isConcatSpreadable"], + 'The value of calls is expected to be ["constructor", "isConcatSpreadable"]' +); diff --git a/test/built-ins/Array/prototype/concat/is-concat-spreadable-is-array-proxy-revoked.js b/test/built-ins/Array/prototype/concat/is-concat-spreadable-is-array-proxy-revoked.js index 126e0e27ed..92cc58f41e 100644 --- a/test/built-ins/Array/prototype/concat/is-concat-spreadable-is-array-proxy-revoked.js +++ b/test/built-ins/Array/prototype/concat/is-concat-spreadable-is-array-proxy-revoked.js @@ -47,4 +47,4 @@ var handle = Proxy.revocable(target, { assert.throws(TypeError, function() { [].concat(handle.proxy); -}); +}, '[].concat(handle.proxy) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/is-concat-spreadable-proxy-revoked.js b/test/built-ins/Array/prototype/concat/is-concat-spreadable-proxy-revoked.js index f2ea3a5bd3..74c8eef6ad 100644 --- a/test/built-ins/Array/prototype/concat/is-concat-spreadable-proxy-revoked.js +++ b/test/built-ins/Array/prototype/concat/is-concat-spreadable-proxy-revoked.js @@ -40,4 +40,4 @@ handle.revoke(); assert.throws(TypeError, function() { [].concat(handle.proxy); -}); +}, '[].concat(handle.proxy) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/is-concat-spreadable-proxy.js b/test/built-ins/Array/prototype/concat/is-concat-spreadable-proxy.js index f32368c003..c86b5f9dad 100644 --- a/test/built-ins/Array/prototype/concat/is-concat-spreadable-proxy.js +++ b/test/built-ins/Array/prototype/concat/is-concat-spreadable-proxy.js @@ -40,12 +40,12 @@ var spreadable = {}; spreadable[Symbol.isConcatSpreadable] = true; var spreadableProxy = new Proxy(spreadable, {}); -assert.sameValue([].concat(arrayProxy).length, 0, 'Proxy for an array'); +assert.sameValue([].concat(arrayProxy).length, 0, 'The value of [].concat(arrayProxy).length is expected to be 0'); assert.sameValue( - [].concat(arrayProxyProxy).length, 0, 'Proxy for a proxy for an array' + [].concat(arrayProxyProxy).length, 0, 'The value of [].concat(arrayProxyProxy).length is expected to be 0' ); assert.sameValue( [].concat(spreadableProxy).length, 0, - 'Proxy for an ordinary object with a truthy @@isConcatSpreadable property' + 'The value of [].concat(spreadableProxy).length is expected to be 0' ); diff --git a/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-falsey.js b/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-falsey.js index 7fa664fbc0..8bd235e2f6 100644 --- a/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-falsey.js +++ b/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-falsey.js @@ -36,20 +36,20 @@ var result; item[Symbol.isConcatSpreadable] = null; result = [].concat(item); -assert.sameValue(result.length, 1); -assert.sameValue(result[0], item); +assert.sameValue(result.length, 1, 'The value of result.length is expected to be 1'); +assert.sameValue(result[0], item, 'The value of result[0] is expected to equal the value of item'); item[Symbol.isConcatSpreadable] = false; result = [].concat(item); -assert.sameValue(result.length, 1); -assert.sameValue(result[0], item); +assert.sameValue(result.length, 1, 'The value of result.length is expected to be 1'); +assert.sameValue(result[0], item, 'The value of result[0] is expected to equal the value of item'); item[Symbol.isConcatSpreadable] = 0; result = [].concat(item); -assert.sameValue(result.length, 1); -assert.sameValue(result[0], item); +assert.sameValue(result.length, 1, 'The value of result.length is expected to be 1'); +assert.sameValue(result[0], item, 'The value of result[0] is expected to equal the value of item'); item[Symbol.isConcatSpreadable] = NaN; result = [].concat(item); -assert.sameValue(result.length, 1); -assert.sameValue(result[0], item); +assert.sameValue(result.length, 1, 'The value of result.length is expected to be 1'); +assert.sameValue(result[0], item, 'The value of result[0] is expected to equal the value of item'); diff --git a/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-truthy.js b/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-truthy.js index c18ab1d012..f7923eb12d 100644 --- a/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-truthy.js +++ b/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-truthy.js @@ -34,20 +34,20 @@ var result; item[Symbol.isConcatSpreadable] = true; result = [].concat(item); -assert.sameValue(result.length, 0); +assert.sameValue(result.length, 0, 'The value of result.length is expected to be 0'); item[Symbol.isConcatSpreadable] = 86; result = [].concat(item); -assert.sameValue(result.length, 0); +assert.sameValue(result.length, 0, 'The value of result.length is expected to be 0'); item[Symbol.isConcatSpreadable] = 'string'; result = [].concat(item); -assert.sameValue(result.length, 0); +assert.sameValue(result.length, 0, 'The value of result.length is expected to be 0'); item[Symbol.isConcatSpreadable] = Symbol(); result = [].concat(item); -assert.sameValue(result.length, 0); +assert.sameValue(result.length, 0, 'The value of result.length is expected to be 0'); item[Symbol.isConcatSpreadable] = {}; result = [].concat(item); -assert.sameValue(result.length, 0); +assert.sameValue(result.length, 0, 'The value of result.length is expected to be 0'); diff --git a/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-undefined.js b/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-undefined.js index 1306800a36..67d277691c 100644 --- a/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-undefined.js +++ b/test/built-ins/Array/prototype/concat/is-concat-spreadable-val-undefined.js @@ -38,4 +38,4 @@ var result; item[Symbol.isConcatSpreadable] = undefined; result = [].concat(item); -assert.sameValue(result.length, 0); +assert.sameValue(result.length, 0, 'The value of result.length is expected to be 0'); diff --git a/test/built-ins/Array/prototype/concat/length.js b/test/built-ins/Array/prototype/concat/length.js index 657441f389..92fa5299aa 100644 --- a/test/built-ins/Array/prototype/concat/length.js +++ b/test/built-ins/Array/prototype/concat/length.js @@ -25,7 +25,7 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.concat.length, 1); +assert.sameValue(Array.prototype.concat.length, 1, 'The value of Array.prototype.concat.length is expected to be 1'); verifyNotEnumerable(Array.prototype.concat, 'length'); verifyNotWritable(Array.prototype.concat, 'length'); diff --git a/test/built-ins/Array/prototype/concat/name.js b/test/built-ins/Array/prototype/concat/name.js index 366b524e5c..90bc748d09 100644 --- a/test/built-ins/Array/prototype/concat/name.js +++ b/test/built-ins/Array/prototype/concat/name.js @@ -19,7 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.concat.name, "concat"); +assert.sameValue( + Array.prototype.concat.name, + "concat", + 'The value of Array.prototype.concat.name is expected to be "concat"' +); verifyNotEnumerable(Array.prototype.concat, "name"); verifyNotWritable(Array.prototype.concat, "name"); diff --git a/test/built-ins/Array/prototype/concat/not-a-constructor.js b/test/built-ins/Array/prototype/concat/not-a-constructor.js index aae4497430..52e60c51bc 100644 --- a/test/built-ins/Array/prototype/concat/not-a-constructor.js +++ b/test/built-ins/Array/prototype/concat/not-a-constructor.js @@ -29,5 +29,5 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.concat([]); -}, '`new Array.prototype.concat([])` throws TypeError'); +}, 'new Array.prototype.concat([]) throws a TypeError exception'); diff --git a/test/built-ins/Array/prototype/concat/prop-desc.js b/test/built-ins/Array/prototype/concat/prop-desc.js index 897899142e..b086e1589c 100644 --- a/test/built-ins/Array/prototype/concat/prop-desc.js +++ b/test/built-ins/Array/prototype/concat/prop-desc.js @@ -14,7 +14,7 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(typeof Array.prototype.concat, 'function', 'typeof'); +assert.sameValue(typeof Array.prototype.concat, 'function', 'The value of `typeof Array.prototype.concat` is expected to be "function"'); verifyNotEnumerable(Array.prototype, "concat"); verifyWritable(Array.prototype, "concat"); diff --git a/test/built-ins/Array/prototype/copyWithin/call-with-boolean.js b/test/built-ins/Array/prototype/copyWithin/call-with-boolean.js index 447f89d7aa..028079e81f 100644 --- a/test/built-ins/Array/prototype/copyWithin/call-with-boolean.js +++ b/test/built-ins/Array/prototype/copyWithin/call-with-boolean.js @@ -9,10 +9,10 @@ description: Array.prototype.copyWithin applied to boolean primitive assert.sameValue( Array.prototype.copyWithin.call(true) instanceof Boolean, true, - 'The result of `(Array.prototype.copyWithin.call(true) instanceof Boolean)` is true' + 'The result of evaluating (Array.prototype.copyWithin.call(true) instanceof Boolean) is expected to be true' ); assert.sameValue( Array.prototype.copyWithin.call(false) instanceof Boolean, true, - 'The result of `(Array.prototype.copyWithin.call(false) instanceof Boolean)` is true' + 'The result of evaluating (Array.prototype.copyWithin.call(false) instanceof Boolean) is expected to be true' ); diff --git a/test/built-ins/Array/prototype/copyWithin/coerced-values-end.js b/test/built-ins/Array/prototype/copyWithin/coerced-values-end.js index ecbd6c021a..166495ea63 100644 --- a/test/built-ins/Array/prototype/copyWithin/coerced-values-end.js +++ b/test/built-ins/Array/prototype/copyWithin/coerced-values-end.js @@ -14,44 +14,32 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, 0, null), [0, 1, 2, 3] - ), - 'null value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, 0, null), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(1, 0, null) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, 0, NaN), [0, 1, 2, 3] - ), - 'NaN value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, 0, NaN), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(1, 0, NaN) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, 0, false), [0, 1, 2, 3] - ), - 'false value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, 0, false), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(1, 0, false) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, 0, true), [0, 0, 2, 3] - ), - 'true value coerced to 1' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, 0, true), [0, 0, 2, 3], + '[0, 1, 2, 3].copyWithin(1, 0, true) must return [0, 0, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, 0, '-2'), [0, 0, 1, 3] - ), - 'string "-2" value coerced to integer -2' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, 0, '-2'), [0, 0, 1, 3], + '[0, 1, 2, 3].copyWithin(1, 0, "-2") must return [0, 0, 1, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, 0, -2.5), [0, 0, 1, 3] - ), - 'float -2.5 value coerced to integer -2' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, 0, -2.5), [0, 0, 1, 3], + '[0, 1, 2, 3].copyWithin(1, 0, -2.5) must return [0, 0, 1, 3]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/coerced-values-start-change-start.js b/test/built-ins/Array/prototype/copyWithin/coerced-values-start-change-start.js index 0f0d82c47a..74c7fa35b9 100644 --- a/test/built-ins/Array/prototype/copyWithin/coerced-values-start-change-start.js +++ b/test/built-ins/Array/prototype/copyWithin/coerced-values-start-change-start.js @@ -18,16 +18,16 @@ includes: [compareArray.js] // make a long integer Array function longDenseArray(){ - var a = [0]; - for(var i = 0; i < 1024; i++){ - a[i] = i; - } - return a; + var a = [0]; + for(var i = 0; i < 1024; i++){ + a[i] = i; + } + return a; } function shorten(){ - currArray.length = 20; - return 1000; + currArray.length = 20; + return 1000; } var array = []; @@ -35,11 +35,9 @@ array.length = 20; var currArray = longDenseArray(); -assert( - compareArray( - currArray.copyWithin(0, {valueOf: shorten}), array - ), - 'coercion side-effect makes start out of bounds' +assert.compareArray( + currArray.copyWithin(0, {valueOf: shorten}), array, + 'currArray.copyWithin(0, {valueOf: shorten}) returns array' ); currArray = longDenseArray(); @@ -48,12 +46,10 @@ Object.setPrototypeOf(currArray, longDenseArray()); var array2 = longDenseArray(); array2.length = 20; for(var i = 0; i < 24; i++){ - array2[i] = Object.getPrototypeOf(currArray)[i+1000]; + array2[i] = Object.getPrototypeOf(currArray)[i+1000]; } -assert( - compareArray( - currArray.copyWithin(0, {valueOf: shorten}), array2 - ), - 'coercion side-effect makes start out of bounds with prototype' +assert.compareArray( + currArray.copyWithin(0, {valueOf: shorten}), array2, + 'currArray.copyWithin(0, {valueOf: shorten}) returns array2' ); diff --git a/test/built-ins/Array/prototype/copyWithin/coerced-values-start-change-target.js b/test/built-ins/Array/prototype/copyWithin/coerced-values-start-change-target.js index d12f03f462..75c7ab4a79 100644 --- a/test/built-ins/Array/prototype/copyWithin/coerced-values-start-change-target.js +++ b/test/built-ins/Array/prototype/copyWithin/coerced-values-start-change-target.js @@ -18,29 +18,27 @@ includes: [compareArray.js] // make a long integer Array function longDenseArray(){ - var a = [0]; - for(var i = 0; i < 1024; i++){ - a[i] = i; - } - return a; + var a = [0]; + for(var i = 0; i < 1024; i++){ + a[i] = i; + } + return a; } function shorten(){ - currArray.length = 20; - return 1; + currArray.length = 20; + return 1; } var array = longDenseArray(); array.length = 20; for(var i = 0; i < 19; i++){ - array[i+1000] = array[i+1]; + array[i+1000] = array[i+1]; } var currArray = longDenseArray(); -assert( - compareArray( - currArray.copyWithin(1000, {valueOf: shorten}), array - ), - 'coercion side-effect makes target out of bounds' +assert.compareArray( + currArray.copyWithin(1000, {valueOf: shorten}), array, + 'currArray.copyWithin(1000, {valueOf: shorten}) returns array' ); diff --git a/test/built-ins/Array/prototype/copyWithin/coerced-values-start.js b/test/built-ins/Array/prototype/copyWithin/coerced-values-start.js index 4a3609e0e4..64330e7cf2 100644 --- a/test/built-ins/Array/prototype/copyWithin/coerced-values-start.js +++ b/test/built-ins/Array/prototype/copyWithin/coerced-values-start.js @@ -13,60 +13,44 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, undefined), [0, 0, 1, 2] - ), - 'undefined value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, undefined), [0, 0, 1, 2], + '[0, 1, 2, 3].copyWithin(1, undefined) must return [0, 0, 1, 2]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, false), [0, 0, 1, 2] - ), - 'false value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, false), [0, 0, 1, 2], + '[0, 1, 2, 3].copyWithin(1, false) must return [0, 0, 1, 2]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, NaN), [0, 0, 1, 2] - ), - 'NaN value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, NaN), [0, 0, 1, 2], + '[0, 1, 2, 3].copyWithin(1, NaN) must return [0, 0, 1, 2]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, null), [0, 0, 1, 2] - ), - 'null value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, null), [0, 0, 1, 2], + '[0, 1, 2, 3].copyWithin(1, null) must return [0, 0, 1, 2]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, true), [1, 2, 3, 3] - ), - 'true value coerced to 1' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, true), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(0, true) must return [1, 2, 3, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, '1'), [1, 2, 3, 3] - ), - 'string "1" value coerced to 1' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, '1'), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(0, "1") must return [1, 2, 3, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, 0.5), [0, 0, 1, 2] - ), - '0.5 float value coerced to integer 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, 0.5), [0, 0, 1, 2], + '[0, 1, 2, 3].copyWithin(1, 0.5) must return [0, 0, 1, 2]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, 1.5), [1, 2, 3, 3] - ), - '1.5 float value coerced to integer 1' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, 1.5), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(0, 1.5) must return [1, 2, 3, 3]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/coerced-values-target.js b/test/built-ins/Array/prototype/copyWithin/coerced-values-target.js index 9fbf4ecc8a..df6962541e 100644 --- a/test/built-ins/Array/prototype/copyWithin/coerced-values-target.js +++ b/test/built-ins/Array/prototype/copyWithin/coerced-values-target.js @@ -13,60 +13,44 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(undefined, 1), [1, 2, 3, 3] - ), - 'undefined value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(undefined, 1), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(undefined, 1) must return [1, 2, 3, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(false, 1), [1, 2, 3, 3] - ), - 'false value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(false, 1), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(false, 1) must return [1, 2, 3, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(NaN, 1), [1, 2, 3, 3] - ), - 'NaN value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(NaN, 1), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(NaN, 1) must return [1, 2, 3, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(null, 1), [1, 2, 3, 3] - ), - 'null value coerced to 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(null, 1), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(null, 1) must return [1, 2, 3, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(true, 0), [0, 0, 1, 2] - ), - 'true value coerced to 1' +assert.compareArray( + [0, 1, 2, 3].copyWithin(true, 0), [0, 0, 1, 2], + '[0, 1, 2, 3].copyWithin(true, 0) must return [0, 0, 1, 2]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin('1', 0), [0, 0, 1, 2] - ), - 'string "1" value coerced to 1' +assert.compareArray( + [0, 1, 2, 3].copyWithin('1', 0), [0, 0, 1, 2], + '[0, 1, 2, 3].copyWithin("1", 0) must return [0, 0, 1, 2]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0.5, 1), [1, 2, 3, 3] - ), - '0.5 float value coerced to integer 0' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0.5, 1), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(0.5, 1) must return [1, 2, 3, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1.5, 0), [0, 0, 1, 2] - ), - '1.5 float value coerced to integer 1' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1.5, 0), [0, 0, 1, 2], + '[0, 1, 2, 3].copyWithin(1.5, 0) must return [0, 0, 1, 2]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-end.js b/test/built-ins/Array/prototype/copyWithin/negative-end.js index 22df7e8df5..98de32cd86 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-end.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-end.js @@ -17,58 +17,42 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, 1, -1), [1, 2, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(0, 1, -1) -> [1, 2, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, 1, -1), [1, 2, 2, 3], + '[0, 1, 2, 3].copyWithin(0, 1, -1) must return [1, 2, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(2, 0, -1), [0, 1, 0, 1, 2] - ), - '[0, 1, 2, 3, 4].copyWithin(2, 0, -1) -> [0, 1, 0, 1, 2]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(2, 0, -1), [0, 1, 0, 1, 2], + '[0, 1, 2, 3, 4].copyWithin(2, 0, -1) must return [0, 1, 0, 1, 2]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(1, 2, -2), [0, 2, 2, 3, 4] - ), - '[0, 1, 2, 3, 4].copyWithin(1, 2, -2) -> [0, 2, 2, 3, 4]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(1, 2, -2), [0, 2, 2, 3, 4], + '[0, 1, 2, 3, 4].copyWithin(1, 2, -2) must return [0, 2, 2, 3, 4]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, -2, -1), [2, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(0, -2, -1) -> [2, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, -2, -1), [2, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(0, -2, -1) must return [2, 1, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(2, -2, -1), [0, 1, 3, 3, 4] - ), - '[0, 1, 2, 3, 4].copyWithin(2, -2, 1) -> [0, 1, 3, 3, 4]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(2, -2, -1), [0, 1, 3, 3, 4], + '[0, 1, 2, 3, 4].copyWithin(2, -2, -1) must return [0, 1, 3, 3, 4]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(-3, -2, -1), [0, 2, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(-3, -2, -1) -> [0, 2, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(-3, -2, -1), [0, 2, 2, 3], + '[0, 1, 2, 3].copyWithin(-3, -2, -1) must return [0, 2, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(-2, -3, -1), [0, 1, 2, 2, 3] - ), - '[0, 1, 2, 3, 4].copyWithin(-2, -3, -1) -> [0, 1, 2, 2, 3]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(-2, -3, -1), [0, 1, 2, 2, 3], + '[0, 1, 2, 3, 4].copyWithin(-2, -3, -1) must return [0, 1, 2, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(-5, -2, -1), [3, 1, 2, 3, 4] - ), - '[0, 1, 2, 3, 4].copyWithin(-5, -2, -1) -> [3, 1, 2, 3, 4]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(-5, -2, -1), [3, 1, 2, 3, 4], + '[0, 1, 2, 3, 4].copyWithin(-5, -2, -1) must return [3, 1, 2, 3, 4]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-end.js b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-end.js index 9285d408df..c832f864e3 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-end.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-end.js @@ -17,72 +17,52 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, 1, -10), [0, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(0, 1, -10) -> [0, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, 1, -10), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(0, 1, -10) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity), [1, 2, 3, 4, 5] - ), - '[1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity) -> [1, 2, 3, 4, 5]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity), [1, 2, 3, 4, 5], + '[1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity) must return [1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, -2, -10), [0, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(0, -2, -10) -> [0, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, -2, -10), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(0, -2, -10) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity), [1, 2, 3, 4, 5] - ), - '[1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity) -> [1, 2, 3, 4, 5]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity), [1, 2, 3, 4, 5], + '[1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity) must return [1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, -9, -10), [0, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(0, -9, -10) -> [0, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, -9, -10), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(0, -9, -10) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity), [1, 2, 3, 4, 5] - ), - '[1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity) -> [1, 2, 3, 4, 5]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity), [1, 2, 3, 4, 5], + '[1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity) must return [1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(-3, -2, -10), [0, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(-3, -2, -10) -> [0, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(-3, -2, -10), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(-3, -2, -10) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity), [1, 2, 3, 4, 5] - ), - '[1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity) -> [1, 2, 3, 4, 5]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity), [1, 2, 3, 4, 5], + '[1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity) must return [1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(-7, -8, -9), [0, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(-7, -8, -9) -> [0, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(-7, -8, -9), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(-7, -8, -9) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity), [1, 2, 3, 4, 5] - ), - '[1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity) -> [1, 2, 3, 4, 5]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity), [1, 2, 3, 4, 5], + '[1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity) must return [1, 2, 3, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-start.js b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-start.js index a5dd431a4f..4afbbcc402 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-start.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-start.js @@ -14,60 +14,44 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, -10), [0, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(0, -10) -> [0, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, -10), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(0, -10) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(0, -Infinity), [1, 2, 3, 4, 5] - ), - '[1, 2, 3, 4, 5].copyWithin(0, -Infinity) -> [1, 2, 3, 4, 5]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(0, -Infinity), [1, 2, 3, 4, 5], + '[1, 2, 3, 4, 5].copyWithin(0, -Infinity) must return [1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(2, -10), [0, 1, 0, 1, 2] - ), - '[0, 1, 2, 3, 4].copyWithin(2, -2) -> [0, 1, 0, 1, 2]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(2, -10), [0, 1, 0, 1, 2], + '[0, 1, 2, 3, 4].copyWithin(2, -10) must return [0, 1, 0, 1, 2]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(2, -Infinity), [1, 2, 1, 2, 3] - ), - '[1, 2, 3, 4, 5].copyWithin(2, -Infinity) -> [1, 2, 1, 2, 3]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(2, -Infinity), [1, 2, 1, 2, 3], + '[1, 2, 3, 4, 5].copyWithin(2, -Infinity) must return [1, 2, 1, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(10, -10), [0, 1, 2, 3, 4] - ), - '[0, 1, 2, 3, 4].copyWithin(10, -10) -> [0, 1, 2, 3, 4]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(10, -10), [0, 1, 2, 3, 4], + '[0, 1, 2, 3, 4].copyWithin(10, -10) must return [0, 1, 2, 3, 4]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(10, -Infinity), [1, 2, 3, 4, 5] - ), - '[1, 2, 3, 4, 5].copyWithin(10, -Infinity) -> [1, 2, 3, 4, 5]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(10, -Infinity), [1, 2, 3, 4, 5], + '[1, 2, 3, 4, 5].copyWithin(10, -Infinity) must return [1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(-9, -10), [0, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(-9, -10) -> [0, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(-9, -10), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(-9, -10) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(-9, -Infinity), [1, 2, 3, 4, 5] - ), - '[1, 2, 3, 4, 5].copyWithin(-9, -Infinity) -> [1, 2, 3, 4, 5]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(-9, -Infinity), [1, 2, 3, 4, 5], + '[1, 2, 3, 4, 5].copyWithin(-9, -Infinity) must return [1, 2, 3, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-target.js b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-target.js index e78c2a6d18..021f196f58 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-target.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-out-of-bounds-target.js @@ -14,30 +14,22 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(-10, 0), [0, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(-10, 0) -> [0, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(-10, 0), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(-10, 0) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(-Infinity, 0), [1, 2, 3, 4, 5] - ), - '[1, 2, 3, 4, 5].copyWithin(-Infinity, 0) -> [1, 2, 3, 4, 5]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(-Infinity, 0), [1, 2, 3, 4, 5], + '[1, 2, 3, 4, 5].copyWithin(-Infinity, 0) must return [1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(-10, 2), [2, 3, 4, 3, 4] - ), - '[0, 1, 2, 3, 4].copyWithin(-10, 2) -> [2, 3, 4, 3, 4]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(-10, 2), [2, 3, 4, 3, 4], + '[0, 1, 2, 3, 4].copyWithin(-10, 2) must return [2, 3, 4, 3, 4]' ); -assert( - compareArray( - [1, 2, 3, 4, 5].copyWithin(-Infinity, 2), [3, 4, 5, 4, 5] - ), - '[1, 2, 3, 4, 5].copyWithin(-Infinity, 2) -> [3, 4, 5, 4, 5]' +assert.compareArray( + [1, 2, 3, 4, 5].copyWithin(-Infinity, 2), [3, 4, 5, 4, 5], + '[1, 2, 3, 4, 5].copyWithin(-Infinity, 2) must return [3, 4, 5, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-start.js b/test/built-ins/Array/prototype/copyWithin/negative-start.js index cda222a507..8f3d862e3d 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-start.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-start.js @@ -14,44 +14,32 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, -1), [3, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(0, -1) -> [3, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, -1), [3, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(0, -1) must return [3, 1, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(2, -2), [0, 1, 3, 4, 4] - ), - '[0, 1, 2, 3, 4].copyWithin(2, -2) -> [0, 1, 3, 4, 4]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(2, -2), [0, 1, 3, 4, 4], + '[0, 1, 2, 3, 4].copyWithin(2, -2) must return [0, 1, 3, 4, 4]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(1, -2), [0, 3, 4, 3, 4] - ), - '[0, 1, 2, 3, 4].copyWithin(1, -2) -> [0, 3, 4, 3, 4]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(1, -2), [0, 3, 4, 3, 4], + '[0, 1, 2, 3, 4].copyWithin(1, -2) must return [0, 3, 4, 3, 4]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(-1, -2), [0, 1, 2, 2] - ), - '[0, 1, 2, 3].copyWithin(-1, -2) -> [ 0, 1, 2, 2 ]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(-1, -2), [0, 1, 2, 2], + '[0, 1, 2, 3].copyWithin(-1, -2) must return [0, 1, 2, 2]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(-2, -3), [0, 1, 2, 2, 3] - ), - '[0, 1, 2, 3, 4].copyWithin(-2, -3) -> [0, 1, 2, 2, 3]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(-2, -3), [0, 1, 2, 2, 3], + '[0, 1, 2, 3, 4].copyWithin(-2, -3) must return [0, 1, 2, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(-5, -2), [3, 4, 2, 3, 4] - ), - '[0, 1, 2, 3, 4].copyWithin(-5, -2) -> [3, 4, 2, 3, 4]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(-5, -2), [3, 4, 2, 3, 4], + '[0, 1, 2, 3, 4].copyWithin(-5, -2) must return [3, 4, 2, 3, 4]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/negative-target.js b/test/built-ins/Array/prototype/copyWithin/negative-target.js index b1a4ebd463..5ae4a18f03 100644 --- a/test/built-ins/Array/prototype/copyWithin/negative-target.js +++ b/test/built-ins/Array/prototype/copyWithin/negative-target.js @@ -14,23 +14,17 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(-1, 0), [0, 1, 2, 0] - ), - '[0, 1, 2, 3].copyWithin(-1, 0) -> [0, 1, 2, 0]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(-1, 0), [0, 1, 2, 0], + '[0, 1, 2, 3].copyWithin(-1, 0) must return [0, 1, 2, 0]' ); -assert( - compareArray( - [0, 1, 2, 3, 4].copyWithin(-2, 2), [0, 1, 2, 2, 3] - ), - '[0, 1, 2, 3, 4].copyWithin(-2, 2) -> [0, 1, 2, 2, 3]' +assert.compareArray( + [0, 1, 2, 3, 4].copyWithin(-2, 2), [0, 1, 2, 2, 3], + '[0, 1, 2, 3, 4].copyWithin(-2, 2) must return [0, 1, 2, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(-1, 2), [0, 1, 2, 2] - ), - '[0, 1, 2, 3].copyWithin(-1, 2) -> [0, 1, 2, 2]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(-1, 2), [0, 1, 2, 2], + '[0, 1, 2, 3].copyWithin(-1, 2) must return [0, 1, 2, 2]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-end.js b/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-end.js index ebea5270dd..ae13ec2dd6 100644 --- a/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-end.js +++ b/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-end.js @@ -33,30 +33,22 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, 1, 6), [1, 2, 3, 3] - ), - '[0, 1, 2, 3].copyWithin(0, 1, 6) -> [1, 2, 3, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, 1, 6), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(0, 1, 6) must return [1, 2, 3, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, 1, Infinity), [1, 2, 3, 3] - ), - '[0, 1, 2, 3].copyWithin(0, 1, Infinity) -> [1, 2, 3, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, 1, Infinity), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(0, 1, Infinity) must return [1, 2, 3, 3]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6), [0, 3, 4, 5, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6) -> [0, 3, 4, 5, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6), [0, 3, 4, 5, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6) must return [0, 3, 4, 5, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity), [0, 3, 4, 5, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity) -> [0, 3, 4, 5, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity), [0, 3, 4, 5, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, Infinity) must return [0, 3, 4, 5, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js b/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js index cc75551e9b..5230f1d8cb 100644 --- a/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js +++ b/test/built-ins/Array/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js @@ -27,109 +27,79 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(6, 0), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(6, 0) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(6, 0), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(6, 0) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(7, 0), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(6, 0) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(7, 0), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(7, 0) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 0) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(6, 2), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(6, 2) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(6, 2), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(6, 2) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(7, 2), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(7, 2) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(7, 2), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(7, 2) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(Infinity, 2) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(0, 6), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(0, 6) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(0, 6), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(0, 6) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(0, 7), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(0, 7) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(0, 7), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(0, 7) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(0, Infinity), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(0, Infinity) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(0, Infinity), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(0, Infinity) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(2, 6), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(2, 6) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(2, 6), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(2, 6) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(1, 7), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(1, 7) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(1, 7), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(1, 7) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(3, Infinity), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(3, Infinity) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(3, Infinity), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(3, Infinity) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(6, 6), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(6, 6) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(6, 6), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(6, 6) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(10, 10), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(10, 10) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(10, 10), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(10, 10) must return [0, 1, 2, 3, 4, 5]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity), [0, 1, 2, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity) => [0, 1, 2, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity), [0, 1, 2, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(Infinity, Infinity) must return [0, 1, 2, 3, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/non-negative-target-and-start.js b/test/built-ins/Array/prototype/copyWithin/non-negative-target-and-start.js index d1840a720f..cf8f60912f 100644 --- a/test/built-ins/Array/prototype/copyWithin/non-negative-target-and-start.js +++ b/test/built-ins/Array/prototype/copyWithin/non-negative-target-and-start.js @@ -31,26 +31,18 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 0), ['a', 'b', 'c', 'd', 'e', 'f'] - ) -); +assert(compareArray( + ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 0), ['a', 'b', 'c', 'd', 'e', 'f'] +), 'compareArray( ["a", "b", "c", "d", "e", "f"].copyWithin(0, 0), ["a", "b", "c", "d", "e", "f"] ) must return true'); -assert( - compareArray( - ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 2), ['c', 'd', 'e', 'f', 'e', 'f'] - ) -); +assert(compareArray( + ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(0, 2), ['c', 'd', 'e', 'f', 'e', 'f'] +), 'compareArray( ["a", "b", "c", "d", "e", "f"].copyWithin(0, 2), ["c", "d", "e", "f", "e", "f"] ) must return true'); -assert( - compareArray( - ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(3, 0), ['a', 'b', 'c', 'a', 'b', 'c'] - ) -); +assert(compareArray( + ['a', 'b', 'c', 'd', 'e', 'f'].copyWithin(3, 0), ['a', 'b', 'c', 'a', 'b', 'c'] +), 'compareArray( ["a", "b", "c", "d", "e", "f"].copyWithin(3, 0), ["a", "b", "c", "a", "b", "c"] ) must return true'); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(1, 4), [0, 4, 5, 3, 4, 5] - ) -); +assert(compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(1, 4), [0, 4, 5, 3, 4, 5] +), 'compareArray( [0, 1, 2, 3, 4, 5].copyWithin(1, 4), [0, 4, 5, 3, 4, 5] ) must return true'); diff --git a/test/built-ins/Array/prototype/copyWithin/non-negative-target-start-and-end.js b/test/built-ins/Array/prototype/copyWithin/non-negative-target-start-and-end.js index a3c02b63d2..2d1d6aa93c 100644 --- a/test/built-ins/Array/prototype/copyWithin/non-negative-target-start-and-end.js +++ b/test/built-ins/Array/prototype/copyWithin/non-negative-target-start-and-end.js @@ -33,25 +33,19 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, 0, 0), [0, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(0, 0, 0) -> [0, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, 0, 0), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(0, 0, 0) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, 0, 2), [0, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(0, 0, 2) -> [0, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, 0, 2), [0, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(0, 0, 2) must return [0, 1, 2, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, 1, 2), [1, 1, 2, 3] - ), - '[0, 1, 2, 3].copyWithin(0, 1, 2) -> [1, 1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, 1, 2), [1, 1, 2, 3], + '[0, 1, 2, 3].copyWithin(0, 1, 2) must return [1, 1, 2, 3]' ); /* @@ -65,16 +59,12 @@ assert( * from = 0 + 2 - 1 * to = 1 + 2 - 1 */ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(1, 0, 2), [0, 0, 1, 3] - ), - '[0, 1, 2, 3].copyWithin(1, 0, 2) -> [0, 0, 1, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(1, 0, 2), [0, 0, 1, 3], + '[0, 1, 2, 3].copyWithin(1, 0, 2) must return [0, 0, 1, 3]' ); -assert( - compareArray( - [0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5), [0, 3, 4, 3, 4, 5] - ), - '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5) -> [0, 3, 4, 3, 4, 5]' +assert.compareArray( + [0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5), [0, 3, 4, 3, 4, 5], + '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5) must return [0, 3, 4, 3, 4, 5]' ); diff --git a/test/built-ins/Array/prototype/copyWithin/undefined-end.js b/test/built-ins/Array/prototype/copyWithin/undefined-end.js index e81642c36e..a0de264e5c 100644 --- a/test/built-ins/Array/prototype/copyWithin/undefined-end.js +++ b/test/built-ins/Array/prototype/copyWithin/undefined-end.js @@ -14,16 +14,12 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, 1, undefined), [1, 2, 3, 3] - ), - '[0, 1, 2, 3].copyWithin(0, 1, undefined) -> [1, 2, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, 1, undefined), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(0, 1, undefined) must return [1, 2, 3, 3]' ); -assert( - compareArray( - [0, 1, 2, 3].copyWithin(0, 1), [1, 2, 3, 3] - ), - '[0, 1, 2, 3].copyWithin(0, 1) -> [1, 2, 3, 3]' +assert.compareArray( + [0, 1, 2, 3].copyWithin(0, 1), [1, 2, 3, 3], + '[0, 1, 2, 3].copyWithin(0, 1) must return [1, 2, 3, 3]' ); diff --git a/test/built-ins/Array/prototype/fill/coerced-indexes.js b/test/built-ins/Array/prototype/fill/coerced-indexes.js index 0b064cf5d4..f5a4707c0e 100644 --- a/test/built-ins/Array/prototype/fill/coerced-indexes.js +++ b/test/built-ins/Array/prototype/fill/coerced-indexes.js @@ -18,72 +18,58 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray([0, 0].fill(1, undefined), [1, 1]), - '`undefined` start coerced to 0' +assert.compareArray([0, 0].fill(1, undefined), [1, 1], + '[0, 0].fill(1, undefined) must return [1, 1]' ); -assert( - compareArray([0, 0].fill(1, 0, undefined), [1, 1]), - 'If end is undefined, let relativeEnd be len' +assert.compareArray([0, 0].fill(1, 0, undefined), [1, 1], + '[0, 0].fill(1, 0, undefined) must return [1, 1]' ); -assert( - compareArray([0, 0].fill(1, null), [1, 1]), - '`null` start coerced to 0' +assert.compareArray([0, 0].fill(1, null), [1, 1], + '[0, 0].fill(1, null) must return [1, 1]' ); -assert( - compareArray([0, 0].fill(1, 0, null), [0, 0]), - '`null` end coerced to 0' +assert.compareArray([0, 0].fill(1, 0, null), [0, 0], + '[0, 0].fill(1, 0, null) must return [0, 0]' ); -assert( - compareArray([0, 0].fill(1, true), [0, 1]), - '`true` start coerced to 1' +assert.compareArray([0, 0].fill(1, true), [0, 1], + '[0, 0].fill(1, true) must return [0, 1]' ); -assert( - compareArray([0, 0].fill(1, 0, true), [1, 0]), - '`true` end coerced to 1' +assert.compareArray([0, 0].fill(1, 0, true), [1, 0], + '[0, 0].fill(1, 0, true) must return [1, 0]' ); -assert( - compareArray([0, 0].fill(1, false), [1, 1]), - '`false` start coerced to 0' +assert.compareArray([0, 0].fill(1, false), [1, 1], + '[0, 0].fill(1, false) must return [1, 1]' ); -assert( - compareArray([0, 0].fill(1, 0, false), [0, 0]), - '`false` end coerced to 0' +assert.compareArray([0, 0].fill(1, 0, false), [0, 0], + '[0, 0].fill(1, 0, false) must return [0, 0]' ); -assert( - compareArray([0, 0].fill(1, NaN), [1, 1]), - '`NaN` start coerced to 0' +assert.compareArray([0, 0].fill(1, NaN), [1, 1], + '[0, 0].fill(1, NaN) must return [1, 1]' ); -assert( - compareArray([0, 0].fill(1, 0, NaN), [0, 0]), - '`NaN` end coerced to 0' +assert.compareArray([0, 0].fill(1, 0, NaN), [0, 0], + '[0, 0].fill(1, 0, NaN) must return [0, 0]' ); -assert( - compareArray([0, 0].fill(1, '1'), [0, 1]), - 'string start coerced' +assert.compareArray([0, 0].fill(1, '1'), [0, 1], + '[0, 0].fill(1, "1") must return [0, 1]' ); -assert( - compareArray([0, 0].fill(1, 0, '1'), [1, 0]), - 'string end coerced' +assert.compareArray([0, 0].fill(1, 0, '1'), [1, 0], + '[0, 0].fill(1, 0, "1") must return [1, 0]' ); -assert( - compareArray([0, 0].fill(1, 1.5), [0, 1]), - 'start as a float number coerced' +assert.compareArray([0, 0].fill(1, 1.5), [0, 1], + '[0, 0].fill(1, 1.5) must return [0, 1]' ); -assert( - compareArray([0, 0].fill(1, 0, 1.5), [1, 0]), - 'end as a float number coerced' +assert.compareArray([0, 0].fill(1, 0, 1.5), [1, 0], + '[0, 0].fill(1, 0, 1.5) must return [1, 0]' ); diff --git a/test/built-ins/Array/prototype/fill/fill-values-custom-start-and-end.js b/test/built-ins/Array/prototype/fill/fill-values-custom-start-and-end.js index ef23dc53ec..cc92a23ea5 100644 --- a/test/built-ins/Array/prototype/fill/fill-values-custom-start-and-end.js +++ b/test/built-ins/Array/prototype/fill/fill-values-custom-start-and-end.js @@ -19,8 +19,20 @@ info: | includes: [compareArray.js] ---*/ -assert(compareArray([0, 0, 0].fill(8, 1, 2), [0, 8, 0])); -assert(compareArray([0, 0, 0, 0, 0].fill(8, -3, 4), [0, 0, 8, 8, 0])); -assert(compareArray([0, 0, 0, 0, 0].fill(8, -2, -1), [0, 0, 0, 8, 0])); -assert(compareArray([0, 0, 0, 0, 0].fill(8, -1, -3), [0, 0, 0, 0, 0])); -assert(compareArray([, , , , 0].fill(8, 1, 3), [, 8, 8, , 0])); +assert.compareArray([0, 0, 0].fill(8, 1, 2), [0, 8, 0], '[0, 0, 0].fill(8, 1, 2) must return [0, 8, 0]'); +assert.compareArray( + [0, 0, 0, 0, 0].fill(8, -3, 4), + [0, 0, 8, 8, 0], + '[0, 0, 0, 0, 0].fill(8, -3, 4) must return [0, 0, 8, 8, 0]' +); +assert.compareArray( + [0, 0, 0, 0, 0].fill(8, -2, -1), + [0, 0, 0, 8, 0], + '[0, 0, 0, 0, 0].fill(8, -2, -1) must return [0, 0, 0, 8, 0]' +); +assert.compareArray( + [0, 0, 0, 0, 0].fill(8, -1, -3), + [0, 0, 0, 0, 0], + '[0, 0, 0, 0, 0].fill(8, -1, -3) must return [0, 0, 0, 0, 0]' +); +assert.compareArray([, , , , 0].fill(8, 1, 3), [, 8, 8, , 0], '[, , , , 0].fill(8, 1, 3) must return [, 8, 8, , 0]'); diff --git a/test/built-ins/Array/prototype/fill/fill-values-relative-end.js b/test/built-ins/Array/prototype/fill/fill-values-relative-end.js index 67131c43f7..bd6e696d26 100644 --- a/test/built-ins/Array/prototype/fill/fill-values-relative-end.js +++ b/test/built-ins/Array/prototype/fill/fill-values-relative-end.js @@ -17,17 +17,14 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray([0, 0, 0].fill(8, 0, 1), [8, 0, 0]), - 'Fill elements from custom end position' +assert.compareArray([0, 0, 0].fill(8, 0, 1), [8, 0, 0], + '[0, 0, 0].fill(8, 0, 1) must return [8, 0, 0]' ); -assert( - compareArray([0, 0, 0].fill(8, 0, -1), [8, 8, 0]), - 'negative end sets final position to max((this.length + relativeEnd), 0)' +assert.compareArray([0, 0, 0].fill(8, 0, -1), [8, 8, 0], + '[0, 0, 0].fill(8, 0, -1) must return [8, 8, 0]' ); -assert( - compareArray([0, 0, 0].fill(8, 0, 5), [8, 8, 8]), - 'end position is never higher than of this.length' +assert.compareArray([0, 0, 0].fill(8, 0, 5), [8, 8, 8], + '[0, 0, 0].fill(8, 0, 5) must return [8, 8, 8]' ); diff --git a/test/built-ins/Array/prototype/fill/fill-values-relative-start.js b/test/built-ins/Array/prototype/fill/fill-values-relative-start.js index 9be8548c4b..a79ea7447b 100644 --- a/test/built-ins/Array/prototype/fill/fill-values-relative-start.js +++ b/test/built-ins/Array/prototype/fill/fill-values-relative-start.js @@ -14,17 +14,14 @@ info: | includes: [compareArray.js] ---*/ -assert( - compareArray([0, 0, 0].fill(8, 1), [0, 8, 8]), - 'Fill elements from custom start position' +assert.compareArray([0, 0, 0].fill(8, 1), [0, 8, 8], + '[0, 0, 0].fill(8, 1) must return [0, 8, 8]' ); -assert( - compareArray([0, 0, 0].fill(8, 4), [0, 0, 0]), - 'start position is never higher than this.length' +assert.compareArray([0, 0, 0].fill(8, 4), [0, 0, 0], + '[0, 0, 0].fill(8, 4) must return [0, 0, 0]' ); -assert( - compareArray([0, 0, 0].fill(8, -1), [0, 0, 8]), - 'negative start sets initial position to max((this.length + relativeStart),0)' +assert.compareArray([0, 0, 0].fill(8, -1), [0, 0, 8], + '[0, 0, 0].fill(8, -1) must return [0, 0, 8]' ); diff --git a/test/built-ins/Array/prototype/fill/fill-values.js b/test/built-ins/Array/prototype/fill/fill-values.js index f1b08dd88b..595544e8bc 100644 --- a/test/built-ins/Array/prototype/fill/fill-values.js +++ b/test/built-ins/Array/prototype/fill/fill-values.js @@ -24,13 +24,10 @@ info: | includes: [compareArray.js] ---*/ -assert(compareArray([].fill(8), [])); +assert.compareArray([].fill(8), [], '[].fill(8) must return []'); -assert(compareArray( - [0, 0].fill(), [undefined, undefined] -)); +assert.compareArray([0, 0].fill(), [undefined, undefined], '[0, 0].fill() must return [undefined, undefined]'); -assert( - compareArray([0, 0, 0].fill(8), [8, 8, 8]), - 'Default start and end indexes are 0 and this.length' +assert.compareArray([0, 0, 0].fill(8), [8, 8, 8], + '[0, 0, 0].fill(8) must return [8, 8, 8]' ); diff --git a/test/built-ins/Array/prototype/flat/array-like-objects.js b/test/built-ins/Array/prototype/flat/array-like-objects.js index 9c9303ff1a..5699b11c17 100644 --- a/test/built-ins/Array/prototype/flat/array-like-objects.js +++ b/test/built-ins/Array/prototype/flat/array-like-objects.js @@ -14,18 +14,18 @@ function getArgumentsObject() { var a = getArgumentsObject([1], [2]); var actual = [].flat.call(a); -assert.compareArray(actual, [1, 2], 'arguments objects'); +assert.compareArray(actual, [1, 2], 'The value of actual is expected to be [1, 2]'); a = { length: 1, 0: [1], }; actual = [].flat.call(a); -assert.compareArray(actual, [1], 'array-like objects'); +assert.compareArray(actual, [1], 'The value of actual is expected to be [1]'); a = { length: undefined, 0: [1], }; actual = [].flat.call(a); -assert.compareArray(actual, [], 'array-like objects; undefined length'); +assert.compareArray(actual, [], 'The value of actual is expected to be []'); diff --git a/test/built-ins/Array/prototype/flat/bound-function-call.js b/test/built-ins/Array/prototype/flat/bound-function-call.js index efff7d963c..40d93a6aac 100644 --- a/test/built-ins/Array/prototype/flat/bound-function-call.js +++ b/test/built-ins/Array/prototype/flat/bound-function-call.js @@ -14,4 +14,4 @@ var a = [ ]; var actual = [].flat.bind(a)(); -assert.compareArray(actual, [0, 1], 'bound flat'); +assert.compareArray(actual, [0, 1], 'The value of actual is expected to be [0, 1]'); diff --git a/test/built-ins/Array/prototype/flat/empty-array-elements.js b/test/built-ins/Array/prototype/flat/empty-array-elements.js index c78eb3c660..3d8d8b1b3f 100644 --- a/test/built-ins/Array/prototype/flat/empty-array-elements.js +++ b/test/built-ins/Array/prototype/flat/empty-array-elements.js @@ -9,16 +9,16 @@ features: [Array.prototype.flat] ---*/ var a = {}; -assert.compareArray([].flat(), []); +assert.compareArray([].flat(), [], '[].flat() must return []'); assert.compareArray([ [], [] -].flat(), []); +].flat(), [], '[ [], [] ].flat() must return []'); assert.compareArray([ [], [1] -].flat(), [1]); +].flat(), [1], '[ [], [1] ].flat() must return [1]'); assert.compareArray([ [], [1, a] -].flat(), [1, a]); +].flat(), [1, a], '[ [], [1, a] ].flat() must return [1, a]'); diff --git a/test/built-ins/Array/prototype/flat/empty-object-elements.js b/test/built-ins/Array/prototype/flat/empty-object-elements.js index dc3e92eb4f..34e339843f 100644 --- a/test/built-ins/Array/prototype/flat/empty-object-elements.js +++ b/test/built-ins/Array/prototype/flat/empty-object-elements.js @@ -11,12 +11,12 @@ features: [Array.prototype.flat] var a = {}, b = {}; -assert.compareArray([a].flat(), [a]); -assert.compareArray([a, [b]].flat(), [a, b]); +assert.compareArray([a].flat(), [a], '[a].flat() must return [a]'); +assert.compareArray([a, [b]].flat(), [a, b], '[a, [b]].flat() must return [a, b]'); assert.compareArray([ [a], b -].flat(), [a, b]); +].flat(), [a, b], '[ [a], b ].flat() must return [a, b]'); assert.compareArray([ [a], [b] -].flat(), [a, b]); +].flat(), [a, b], '[ [a], [b] ].flat() must return [a, b]'); diff --git a/test/built-ins/Array/prototype/flat/non-numeric-depth-should-not-throw.js b/test/built-ins/Array/prototype/flat/non-numeric-depth-should-not-throw.js index 946465094c..94c1ca65fd 100644 --- a/test/built-ins/Array/prototype/flat/non-numeric-depth-should-not-throw.js +++ b/test/built-ins/Array/prototype/flat/non-numeric-depth-should-not-throw.js @@ -14,30 +14,30 @@ var expected = a; // non integral string depthNum is converted to 0 var depthNum = 'TestString'; var actual = a.flat(depthNum); -assert(compareArray(actual, expected), 'non integral string depthNum'); +assert.compareArray(actual, expected, 'The value of actual is expected to equal the value of expected'); // object type depthNum is converted to 0 depthNum = {}; actual = a.flat(depthNum); -assert(compareArray(actual, expected), 'object type depthNum'); +assert.compareArray(actual, expected, 'The value of actual is expected to equal the value of expected'); // negative infinity depthNum is converted to 0 depthNum = Number.NEGATIVE_INFINITY; actual = a.flat(depthNum); -assert(compareArray(actual, expected), 'negative infinity depthNum'); +assert.compareArray(actual, expected, 'The value of actual is expected to equal the value of expected'); // positive zero depthNum is converted to 0 depthNum = +0; actual = a.flat(depthNum); -assert(compareArray(actual, expected), 'positive zero depthNum'); +assert.compareArray(actual, expected, 'The value of actual is expected to equal the value of expected'); // negative zero depthNum is converted to 0 depthNum = -0; actual = a.flat(depthNum); -assert(compareArray(actual, expected), 'negative zero depthNum'); +assert.compareArray(actual, expected, 'The value of actual is expected to equal the value of expected'); // integral string depthNum is converted to an integer depthNum = '1'; actual = a.flat(depthNum); expected = [1, 2] -assert(compareArray(actual, expected), 'integral string depthNum'); +assert.compareArray(actual, expected, 'The value of actual is expected to equal the value of expected'); diff --git a/test/built-ins/Array/prototype/flat/null-undefined-elements.js b/test/built-ins/Array/prototype/flat/null-undefined-elements.js index a252f10bc8..e65c7b33b2 100644 --- a/test/built-ins/Array/prototype/flat/null-undefined-elements.js +++ b/test/built-ins/Array/prototype/flat/null-undefined-elements.js @@ -10,11 +10,23 @@ features: [Array.prototype.flat] var a = [void 0]; -assert(compareArray([1, null, void 0].flat(), [1, null, undefined])); -assert(compareArray([1, [null, void 0]].flat(), [1, null, undefined])); -assert(compareArray([ +assert.compareArray( + [1, null, void 0].flat(), + [1, null, undefined], + '[1, null, void 0].flat() must return [1, null, undefined]' +); +assert.compareArray( + [1, [null, void 0]].flat(), + [1, null, undefined], + '[1, [null, void 0]].flat() must return [1, null, undefined]' +); +assert.compareArray([ [null, void 0], [null, void 0] -].flat(), [null, undefined, null, undefined])); -assert(compareArray([1, [null, a]].flat(1), [1, null, a])); -assert(compareArray([1, [null, a]].flat(2), [1, null, undefined])); +].flat(), [null, undefined, null, undefined], '[ [null, void 0], [null, void 0] ].flat() must return [null, undefined, null, undefined]'); +assert.compareArray([1, [null, a]].flat(1), [1, null, a], '[1, [null, a]].flat(1) must return [1, null, a]'); +assert.compareArray( + [1, [null, a]].flat(2), + [1, null, undefined], + '[1, [null, a]].flat(2) must return [1, null, undefined]' +); diff --git a/test/built-ins/Array/prototype/flat/positive-infinity.js b/test/built-ins/Array/prototype/flat/positive-infinity.js index 381200976a..04b5f28e7b 100644 --- a/test/built-ins/Array/prototype/flat/positive-infinity.js +++ b/test/built-ins/Array/prototype/flat/positive-infinity.js @@ -9,4 +9,4 @@ features: [Array.prototype.flat] ---*/ var a = [1, [2, [3, [4]]]] -assert(compareArray(a.flat(Number.POSITIVE_INFINITY), [1, 2, 3, 4]), 'positive infinity depthNum'); +assert.compareArray(a.flat(Number.POSITIVE_INFINITY), [1, 2, 3, 4], 'a.flat(Number.POSITIVE_INFINITY) must return [1, 2, 3, 4]'); diff --git a/test/built-ins/Array/prototype/flat/proxy-access-count.js b/test/built-ins/Array/prototype/flat/proxy-access-count.js index 9dbc4839c2..c6c27e25c6 100644 --- a/test/built-ins/Array/prototype/flat/proxy-access-count.js +++ b/test/built-ins/Array/prototype/flat/proxy-access-count.js @@ -32,5 +32,5 @@ const tier1 = new Proxy([2, [3, [4, 2], 2], 5, tier2, 6], handler); Array.prototype.flat.call(tier1, 3); -assert.compareArray(getCalls, ["length", "constructor", "0", "1", "2", "3", "length", "0", "1", "4"], 'getProperty by .flat should occur exactly once per property and once for length and constructor'); -assert.compareArray(hasCalls, ["0", "1", "2", "3", "0", "1", "4"], 'hasProperty by .flat should occur exactly once per property'); +assert.compareArray(getCalls, ["length", "constructor", "0", "1", "2", "3", "length", "0", "1", "4"], 'The value of getCalls is expected to be ["length", "constructor", "0", "1", "2", "3", "length", "0", "1", "4"]'); +assert.compareArray(hasCalls, ["0", "1", "2", "3", "0", "1", "4"], 'The value of hasCalls is expected to be ["0", "1", "2", "3", "0", "1", "4"]'); diff --git a/test/built-ins/Array/prototype/flatMap/array-like-objects-nested.js b/test/built-ins/Array/prototype/flatMap/array-like-objects-nested.js index 82f5a2dc4a..af36d4d232 100644 --- a/test/built-ins/Array/prototype/flatMap/array-like-objects-nested.js +++ b/test/built-ins/Array/prototype/flatMap/array-like-objects-nested.js @@ -50,8 +50,8 @@ var obj3 = { var arr = [obj1, obj2, obj3]; var actual = arr.flatMap(fn); -assert.compareArray(actual, arr, 'returns a similar array'); -assert.notSameValue(actual, arr, 'not the same array'); +assert.compareArray(actual, arr, 'The value of actual is expected to equal the value of arr'); +assert.notSameValue(actual, arr, 'The value of actual is expected to not equal the value of `arr`'); var arrLike = { length: 4, @@ -63,6 +63,10 @@ var arrLike = { }; actual = [].flatMap.call(arrLike, fn); -assert.compareArray(actual, [obj1, obj2, obj3, arrLike], 'returns a similar array'); -assert.notSameValue(actual, arrLike, 'not the same object'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype); +assert.compareArray(actual, [obj1, obj2, obj3, arrLike], 'The value of actual is expected to be [obj1, obj2, obj3, arrLike]'); +assert.notSameValue(actual, arrLike, 'The value of actual is expected to not equal the value of `arrLike`'); +assert.sameValue( + Object.getPrototypeOf(actual), + Array.prototype, + 'Object.getPrototypeOf([].flatMap.call(arrLike, fn)") returns Array.prototype' +); diff --git a/test/built-ins/Array/prototype/flatMap/array-like-objects-typedarrays.js b/test/built-ins/Array/prototype/flatMap/array-like-objects-typedarrays.js index fd0dd5a192..f8e567a05b 100644 --- a/test/built-ins/Array/prototype/flatMap/array-like-objects-typedarrays.js +++ b/test/built-ins/Array/prototype/flatMap/array-like-objects-typedarrays.js @@ -35,9 +35,9 @@ Object.defineProperty(ta, 'constructor', { get() { throw "it should not object the typedarray ctor"; } }); actual = [].flatMap.call(ta, same); -assert.compareArray(actual, [1, 0, 42], 'compare returned array'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'returned object is an array #1'); -assert.sameValue(actual instanceof Int32Array, false, 'returned object is not an instance of Int32Array #1'); +assert.compareArray(actual, [1, 0, 42], 'The value of actual is expected to be [1, 0, 42]'); +assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'Object.getPrototypeOf([].flatMap.call(ta, same)") returns Array.prototype'); +assert.sameValue(actual instanceof Int32Array, false, 'The result of evaluating (actual instanceof Int32Array) is expected to be false'); ta = new Int32Array(0); @@ -45,6 +45,6 @@ Object.defineProperty(ta, 'constructor', { get() { throw "it should not object the typedarray ctor"; } }); actual = [].flatMap.call(ta, same); -assert.compareArray(actual, [], 'compare returned empty array'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'returned object is an array #2'); -assert.sameValue(actual instanceof Int32Array, false, 'returned object is not an instance of Int32Array #2'); +assert.compareArray(actual, [], 'The value of actual is expected to be []'); +assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'Object.getPrototypeOf([].flatMap.call(ta, same)") returns Array.prototype'); +assert.sameValue(actual instanceof Int32Array, false, 'The result of evaluating (actual instanceof Int32Array) is expected to be false'); diff --git a/test/built-ins/Array/prototype/flatMap/array-like-objects.js b/test/built-ins/Array/prototype/flatMap/array-like-objects.js index 5a8a2fca33..6e33e968b9 100644 --- a/test/built-ins/Array/prototype/flatMap/array-like-objects.js +++ b/test/built-ins/Array/prototype/flatMap/array-like-objects.js @@ -47,16 +47,16 @@ a = { get 3() { throw 'it should not get this property'; } }; actual = [].flatMap.call(a, fn); -assert.compareArray(actual, [39, 2, 39, 42], 'array-like flattened object, number length'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'returned object is an array #1'); +assert.compareArray(actual, [39, 2, 39, 42], 'The value of actual is expected to be [39, 2, 39, 42]'); +assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'Object.getPrototypeOf([].flatMap.call(a, fn)") returns Array.prototype'); a = { length: undefined, get 0() { throw 'it should not get this property'; }, }; actual = [].flatMap.call(a, fn); -assert.compareArray(actual, [], 'array-like objects; undefined length'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'returned object is an array #2'); +assert.compareArray(actual, [], 'The value of actual is expected to be []'); +assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'Object.getPrototypeOf([].flatMap.call(a, fn)") returns Array.prototype'); var called = false; a = { @@ -73,13 +73,13 @@ a = { get 2() { throw 'it should not get this property'; }, }; actual = [].flatMap.call(a, fn); -assert.compareArray(actual, [39, 42, 39, 39], 'array-like flattened objects; custom get length'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'returned object is an array #3'); +assert.compareArray(actual, [39, 42, 39, 39], 'The value of actual is expected to be [39, 42, 39, 39]'); +assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'Object.getPrototypeOf([].flatMap.call(a, fn)") returns Array.prototype'); a = { length: 10001, [10000]: 7, }; actual = [].flatMap.call(a, fn); -assert.compareArray(actual, [39, 14], 'array-like flattened object, long length simulating shallow array'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'returned object is an array #4'); +assert.compareArray(actual, [39, 14], 'The value of actual is expected to be [39, 14]'); +assert.sameValue(Object.getPrototypeOf(actual), Array.prototype, 'Object.getPrototypeOf([].flatMap.call(a, fn)") returns Array.prototype'); diff --git a/test/built-ins/Array/prototype/flatMap/bound-function-argument.js b/test/built-ins/Array/prototype/flatMap/bound-function-argument.js index daa3141157..898f43365e 100644 --- a/test/built-ins/Array/prototype/flatMap/bound-function-argument.js +++ b/test/built-ins/Array/prototype/flatMap/bound-function-argument.js @@ -11,4 +11,4 @@ features: [Array.prototype.flatMap] var a = [0, 0]; assert.compareArray(a.flatMap(function() { return this; -}.bind([1, 2])), [1, 2, 1, 2]); +}.bind([1, 2])), [1, 2, 1, 2], 'a.flatMap(function() {return this;}.bind([1, 2])) must return [1, 2, 1, 2]'); diff --git a/test/built-ins/Array/prototype/flatMap/depth-always-one.js b/test/built-ins/Array/prototype/flatMap/depth-always-one.js index 4f5f672b48..d372cff99c 100644 --- a/test/built-ins/Array/prototype/flatMap/depth-always-one.js +++ b/test/built-ins/Array/prototype/flatMap/depth-always-one.js @@ -10,14 +10,14 @@ features: [Array.prototype.flatMap] assert.compareArray([1, 2].flatMap(function(e) { return [e, e * 2]; -}), [1, 2, 2, 4], 'array depth is 1'); +}), [1, 2, 2, 4], '[1, 2].flatMap(function(e) {return [e, e * 2];}) must return [1, 2, 2, 4]'); var result = [1, 2, 3].flatMap(function(ele) { return [ [ele * 2] ]; }); -assert.sameValue(result.length, 3, 'array depth is more than 1 - length'); -assert.compareArray(result[0], [2], 'array depth is more than 1 - 1st element'); -assert.compareArray(result[1], [4], 'array depth is more than 1 - 2nd element'); -assert.compareArray(result[2], [6], 'array depth is more than 1 - 3rd element'); +assert.sameValue(result.length, 3, 'The value of result.length is expected to be 3'); +assert.compareArray(result[0], [2], 'The value of result[0] is expected to be [2]'); +assert.compareArray(result[1], [4], 'The value of result[1] is expected to be [4]'); +assert.compareArray(result[2], [6], 'The value of result[2] is expected to be [6]'); diff --git a/test/built-ins/Array/prototype/flatMap/proxy-access-count.js b/test/built-ins/Array/prototype/flatMap/proxy-access-count.js index 4e7edbd689..dbcf69122a 100644 --- a/test/built-ins/Array/prototype/flatMap/proxy-access-count.js +++ b/test/built-ins/Array/prototype/flatMap/proxy-access-count.js @@ -21,7 +21,11 @@ features: [Array.prototype.flatMap] includes: [compareArray.js] ---*/ -assert.sameValue(typeof Array.prototype.flatMap, 'function'); +assert.sameValue( + typeof Array.prototype.flatMap, + 'function', + 'The value of `typeof Array.prototype.flatMap` is expected to be "function"' +); const getCalls = [], hasCalls = []; const handler = { @@ -34,5 +38,5 @@ const tier1 = new Proxy([2, [3, 4, 2, 2], 5, tier2, 6], handler); Array.prototype.flatMap.call(tier1, function(a){ return a; }); -assert.compareArray(getCalls, ["length", "constructor", "0", "1", "2", "3", "length", "0", "1", "4"], 'getProperty by .flatMap should occur exactly once per property and once for length and constructor'); -assert.compareArray(hasCalls, ["0", "1", "2", "3", "0", "1", "4"], 'hasProperty by .flatMap should occur exactly once per property'); +assert.compareArray(getCalls, ["length", "constructor", "0", "1", "2", "3", "length", "0", "1", "4"], 'The value of getCalls is expected to be ["length", "constructor", "0", "1", "2", "3", "length", "0", "1", "4"]'); +assert.compareArray(hasCalls, ["0", "1", "2", "3", "0", "1", "4"], 'The value of hasCalls is expected to be ["0", "1", "2", "3", "0", "1", "4"]'); diff --git a/test/built-ins/Array/prototype/flatMap/this-value-ctor-non-object.js b/test/built-ins/Array/prototype/flatMap/this-value-ctor-non-object.js index a71ad5a4ed..beabd126a1 100644 --- a/test/built-ins/Array/prototype/flatMap/this-value-ctor-non-object.js +++ b/test/built-ins/Array/prototype/flatMap/this-value-ctor-non-object.js @@ -32,7 +32,11 @@ features: [Array.prototype.flatMap, Symbol] includes: [compareArray.js] ---*/ -assert.sameValue(typeof Array.prototype.flatMap, 'function'); +assert.sameValue( + typeof Array.prototype.flatMap, + 'function', + 'The value of `typeof Array.prototype.flatMap` is expected to be "function"' +); var a = []; var mapperFn = function() {}; @@ -40,35 +44,39 @@ var mapperFn = function() {}; a.constructor = null; assert.throws(TypeError, function() { a.flatMap(mapperFn); -}, 'null value'); +}, 'a.flatMap(mapperFn) throws a TypeError exception'); a = []; a.constructor = 1; assert.throws(TypeError, function() { a.flatMap(mapperFn); -}, 'number value'); +}, 'a.flatMap(mapperFn) throws a TypeError exception'); a = []; a.constructor = 'string'; assert.throws(TypeError, function() { a.flatMap(mapperFn); -}, 'string value'); +}, 'a.flatMap(mapperFn) throws a TypeError exception'); a = []; a.constructor = true; assert.throws(TypeError, function() { a.flatMap(mapperFn); -}, 'boolean value'); +}, 'a.flatMap(mapperFn) throws a TypeError exception'); a = []; a.constructor = Symbol(); assert.throws(TypeError, function() { a.flatMap(mapperFn); -}, 'symbol value'); +}, 'a.flatMap(mapperFn) throws a TypeError exception'); a = []; a.constructor = undefined; var actual = a.flatMap(mapperFn); -assert.compareArray(actual, [], 'undefined value does not throw'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype); -assert.notSameValue(actual, a, 'returns a new array'); +assert.compareArray(actual, [], 'The value of actual is expected to be []'); +assert.sameValue( + Object.getPrototypeOf(actual), + Array.prototype, + 'Object.getPrototypeOf(a.flatMap(mapperFn)) returns Array.prototype' +); +assert.notSameValue(actual, a, 'The value of actual is expected to not equal the value of `a`'); diff --git a/test/built-ins/Array/prototype/flatMap/this-value-ctor-object-species-bad-throws.js b/test/built-ins/Array/prototype/flatMap/this-value-ctor-object-species-bad-throws.js index 9ea5f2a02b..c5d97cef12 100644 --- a/test/built-ins/Array/prototype/flatMap/this-value-ctor-object-species-bad-throws.js +++ b/test/built-ins/Array/prototype/flatMap/this-value-ctor-object-species-bad-throws.js @@ -34,15 +34,23 @@ features: [Array.prototype.flatMap, Symbol, Symbol.species] includes: [compareArray.js] ---*/ -assert.sameValue(typeof Array.prototype.flatMap, 'function'); +assert.sameValue( + typeof Array.prototype.flatMap, + 'function', + 'The value of `typeof Array.prototype.flatMap` is expected to be "function"' +); var arr = [[42, 1], [42, 2]]; var mapperFn = function(e) { return e; }; arr.constructor = {}; var actual = arr.flatMap(mapperFn); -assert.compareArray(actual, [42, 1, 42, 2], 'undefined species does not throw'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype); +assert.compareArray(actual, [42, 1, 42, 2], 'The value of actual is expected to be [42, 1, 42, 2]'); +assert.sameValue( + Object.getPrototypeOf(actual), + Array.prototype, + 'Object.getPrototypeOf(arr.flatMap(mapperFn)) returns Array.prototype' +); var called = 0; arr.constructor = { @@ -53,8 +61,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is a number'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -65,8 +73,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is a string'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -77,8 +85,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is a boolean'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -89,8 +97,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is an object'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -101,8 +109,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is an array'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -113,8 +121,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is a symbol'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -125,5 +133,5 @@ arr.constructor = { }; assert.throws(Test262Error, function() { arr.flatMap(mapperFn); -}, 'Return abrupt completion from getting the @@species'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a Test262Error exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); diff --git a/test/built-ins/Array/prototype/flatMap/this-value-ctor-object-species.js b/test/built-ins/Array/prototype/flatMap/this-value-ctor-object-species.js index a8d560bff2..1b48ee4737 100644 --- a/test/built-ins/Array/prototype/flatMap/this-value-ctor-object-species.js +++ b/test/built-ins/Array/prototype/flatMap/this-value-ctor-object-species.js @@ -34,15 +34,23 @@ features: [Array.prototype.flatMap, Symbol, Symbol.species] includes: [compareArray.js] ---*/ -assert.sameValue(typeof Array.prototype.flatMap, 'function'); +assert.sameValue( + typeof Array.prototype.flatMap, + 'function', + 'The value of `typeof Array.prototype.flatMap` is expected to be "function"' +); var arr = [[42, 1], [42, 2]]; var mapperFn = function(e) { return e; }; arr.constructor = {}; var actual = arr.flatMap(mapperFn); -assert.compareArray(actual, [42, 1, 42, 2], 'undefined species does not throw'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype); +assert.compareArray(actual, [42, 1, 42, 2], 'The value of actual is expected to be [42, 1, 42, 2]'); +assert.sameValue( + Object.getPrototypeOf(actual), + Array.prototype, + 'Object.getPrototypeOf(arr.flatMap(mapperFn)) returns Array.prototype' +); var called = 0; arr.constructor = { @@ -52,9 +60,13 @@ arr.constructor = { } }; actual = arr.flatMap(mapperFn); -assert.compareArray(actual, [42, 1, 42, 2], 'null species value does not throw'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype); -assert.sameValue(called, 1, 'got species once'); +assert.compareArray(actual, [42, 1, 42, 2], 'The value of actual is expected to be [42, 1, 42, 2]'); +assert.sameValue( + Object.getPrototypeOf(actual), + Array.prototype, + 'Object.getPrototypeOf(arr.flatMap(mapperFn)) returns Array.prototype' +); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -64,9 +76,13 @@ arr.constructor = { } }; actual = arr.flatMap(mapperFn); -assert.compareArray(actual, [42, 1, 42, 2], 'undefined species value does not throw'); -assert.sameValue(Object.getPrototypeOf(actual), Array.prototype); -assert.sameValue(called, 1, 'got species once'); +assert.compareArray(actual, [42, 1, 42, 2], 'The value of actual is expected to be [42, 1, 42, 2]'); +assert.sameValue( + Object.getPrototypeOf(actual), + Array.prototype, + 'Object.getPrototypeOf(arr.flatMap(mapperFn)) returns Array.prototype' +); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -77,8 +93,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is a number'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -89,8 +105,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is a string'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -101,8 +117,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is a boolean'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -113,8 +129,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is an object'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -125,8 +141,8 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is an array'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); called = 0; arr.constructor = { @@ -137,5 +153,5 @@ arr.constructor = { }; assert.throws(TypeError, function() { arr.flatMap(mapperFn); -}, 'throw TypeError if @@species is a symbol'); -assert.sameValue(called, 1, 'got species once'); +}, 'arr.flatMap(mapperFn) throws a TypeError exception'); +assert.sameValue(called, 1, 'The value of called is expected to be 1'); diff --git a/test/built-ins/Array/prototype/flatMap/thisArg-argument.js b/test/built-ins/Array/prototype/flatMap/thisArg-argument.js index 24b52af747..835e384f53 100644 --- a/test/built-ins/Array/prototype/flatMap/thisArg-argument.js +++ b/test/built-ins/Array/prototype/flatMap/thisArg-argument.js @@ -16,30 +16,30 @@ var actual; actual = [1].flatMap(function() { return [this]; }, "TestString"); -assert.compareArray(actual, ["TestString"]); +assert.compareArray(actual, ["TestString"], 'The value of actual is expected to be ["TestString"]'); actual = [1].flatMap(function() { return [this]; }, 1); -assert.compareArray(actual, [1]); +assert.compareArray(actual, [1], 'The value of actual is expected to be [1]'); actual = [1].flatMap(function() { return [this]; }, null); -assert.compareArray(actual, [null]); +assert.compareArray(actual, [null], 'The value of actual is expected to be [null]'); actual = [1].flatMap(function() { return [this]; }, true); -assert.compareArray(actual, [true]); +assert.compareArray(actual, [true], 'The value of actual is expected to be [true]'); actual = [1].flatMap(function() { return [this]; }, a); -assert.compareArray(actual, [a]); +assert.compareArray(actual, [a], 'The value of actual is expected to be [a]'); actual = [1].flatMap(function() { return [this]; }, void 0); -assert.compareArray(actual, [undefined]); +assert.compareArray(actual, [undefined], 'The value of actual is expected to be [undefined]'); diff --git a/test/built-ins/Array/prototype/includes/get-prop.js b/test/built-ins/Array/prototype/includes/get-prop.js index 069b77a298..bea3d5a9af 100644 --- a/test/built-ins/Array/prototype/includes/get-prop.js +++ b/test/built-ins/Array/prototype/includes/get-prop.js @@ -32,12 +32,15 @@ var p = new Proxy(obj, { }); calls = []; -assert.sameValue([].includes.call(p, 42), false); -assert( - compareArray(calls, ["length", "0", "1", "2", "3"]), - "loops through all indexes" +assert.sameValue( + [].includes.call(p, 42), + false, + '[].includes.call("new Proxy(obj, {get: function(_, key) {calls.push(key); if (key === "length") {return 4;} return key * 10;}})", 42) must return false' +); +assert.compareArray(calls, ["length", "0", "1", "2", "3"], + 'The value of calls is expected to be ["length", "0", "1", "2", "3"]' ); calls = []; -assert.sameValue([].includes.call(p, 10), true, "uses the returned value"); -assert(compareArray(calls, ["length", "0", "1"]), "loops until value is found"); +assert.sameValue([].includes.call(p, 10), true, '[].includes.call("new Proxy(obj, {get: function(_, key) {calls.push(key); if (key === "length") {return 4;} return key * 10;}})", 10) must return true'); +assert.compareArray(calls, ["length", "0", "1"], 'The value of calls is expected to be ["length", "0", "1"]'); diff --git a/test/built-ins/Array/prototype/reduceRight/length-near-integer-limit.js b/test/built-ins/Array/prototype/reduceRight/length-near-integer-limit.js index f955b66e62..9d297caddb 100644 --- a/test/built-ins/Array/prototype/reduceRight/length-near-integer-limit.js +++ b/test/built-ins/Array/prototype/reduceRight/length-near-integer-limit.js @@ -43,7 +43,15 @@ try { Array.prototype.reduceRight.call(arrayLike, accumulator, []); throw new Test262Error("should not be called"); } catch (acc) { - assert.sameValue(acc.length, 2); - assert.compareArray(acc[0], [1, Number.MAX_SAFE_INTEGER - 1]); - assert.compareArray(acc[1], [3, Number.MAX_SAFE_INTEGER - 3]); + assert.sameValue(acc.length, 2, 'The value of acc.length is expected to be 2'); + assert.compareArray( + acc[0], + [1, Number.MAX_SAFE_INTEGER - 1], + 'The value of acc[0] is expected to be [1, Number.MAX_SAFE_INTEGER - 1]' + ); + assert.compareArray( + acc[1], + [3, Number.MAX_SAFE_INTEGER - 3], + 'The value of acc[1] is expected to be [3, Number.MAX_SAFE_INTEGER - 3]' + ); } diff --git a/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-proxy.js b/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-proxy.js index 308eb5e192..f827f9f162 100644 --- a/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-proxy.js +++ b/test/built-ins/Array/prototype/reverse/length-exceeding-integer-limit-with-proxy.js @@ -61,7 +61,7 @@ var proxy = new Proxy(arrayLike, allowProxyTraps({ // are properly propagated. assert.throws(StopReverse, function() { Array.prototype.reverse.call(proxy); -}); +}, 'Array.prototype.reverse.call(proxy) throws a StopReverse exception'); assert.compareArray(traps, [ // Initial get length operation. @@ -104,16 +104,16 @@ assert.compareArray(traps, [ // Stop exception. "Has:4", "Get:4", -]); +], 'The value of traps is expected to be [\n // Initial get length operation.\n "Get:length",\n\n // Lower and upper index are both present.\n "Has:0",\n "Get:0",\n "Has:9007199254740990",\n "Get:9007199254740990",\n "Set:0",\n "GetOwnPropertyDescriptor:0",\n "DefineProperty:0",\n "Set:9007199254740990",\n "GetOwnPropertyDescriptor:9007199254740990",\n "DefineProperty:9007199254740990",\n\n // Lower and upper index are both absent.\n "Has:1",\n "Has:9007199254740989",\n\n // Lower index is present, upper index is absent.\n "Has:2",\n "Get:2",\n "Has:9007199254740988",\n "Delete:2",\n "Set:9007199254740988",\n "GetOwnPropertyDescriptor:9007199254740988",\n "DefineProperty:9007199254740988",\n\n // Lower index is absent, upper index is present.\n "Has:3",\n "Has:9007199254740987",\n "Get:9007199254740987",\n "Set:3",\n "GetOwnPropertyDescriptor:3",\n "DefineProperty:3",\n "Delete:9007199254740987",\n\n // Stop exception.\n "Has:4",\n "Get:4",\n]'); -assert.sameValue(arrayLike.length, 2 ** 53 + 2, "Length property is not modified"); +assert.sameValue(arrayLike.length, 2 ** 53 + 2, 'The value of arrayLike.length is expected to be 2 ** 53 + 2'); -assert.sameValue(arrayLike[0], "2**53-2", "Property at index 0"); -assert.sameValue(1 in arrayLike, false, "Property at index 1"); -assert.sameValue(2 in arrayLike, false, "Property at index 2"); -assert.sameValue(arrayLike[3], "2**53-5", "Property at index 3"); +assert.sameValue(arrayLike[0], "2**53-2", 'The value of arrayLike[0] is expected to be "2**53-2"'); +assert.sameValue(1 in arrayLike, false, 'The result of evaluating (1 in arrayLike) is expected to be false'); +assert.sameValue(2 in arrayLike, false, 'The result of evaluating (2 in arrayLike) is expected to be false'); +assert.sameValue(arrayLike[3], "2**53-5", 'The value of arrayLike[3] is expected to be "2**53-5"'); -assert.sameValue(9007199254740987 in arrayLike, false, "Property at index 2**53-5"); -assert.sameValue(arrayLike[9007199254740988], "two", "Property at index 2**53-4"); -assert.sameValue(9007199254740989 in arrayLike, false, "Property at index 2**53-3"); -assert.sameValue(arrayLike[9007199254740990], "zero", "Property at index 2**53-2"); +assert.sameValue(9007199254740987 in arrayLike, false, 'The result of evaluating (9007199254740987 in arrayLike) is expected to be false'); +assert.sameValue(arrayLike[9007199254740988], "two", 'The value of arrayLike[9007199254740988] is expected to be "two"'); +assert.sameValue(9007199254740989 in arrayLike, false, 'The result of evaluating (9007199254740989 in arrayLike) is expected to be false'); +assert.sameValue(arrayLike[9007199254740990], "zero", 'The value of arrayLike[9007199254740990] is expected to be "zero"'); diff --git a/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit-proxied-array.js b/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit-proxied-array.js index d1839760a1..79ca743e08 100644 --- a/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit-proxied-array.js +++ b/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit-proxied-array.js @@ -37,20 +37,20 @@ var proxy = new Proxy(array, { var result = Array.prototype.slice.call(proxy, 9007199254740989); assert.compareArray(result, ["9007199254740989", "9007199254740990"], - "slice(9007199254740989)"); + 'The value of result is expected to be ["9007199254740989", "9007199254740990"]'); var result = Array.prototype.slice.call(proxy, 9007199254740989, 9007199254740990); assert.compareArray(result, ["9007199254740989"], - "slice(9007199254740989, 9007199254740990)"); + 'The value of result is expected to be ["9007199254740989"]'); var result = Array.prototype.slice.call(proxy, 9007199254740989, 9007199254740996); assert.compareArray(result, ["9007199254740989", "9007199254740990"], - "slice(9007199254740989, 9007199254740996)"); + 'The value of result is expected to be ["9007199254740989", "9007199254740990"]'); var result = Array.prototype.slice.call(proxy, -2); assert.compareArray(result, ["9007199254740989", "9007199254740990"], - "slice(-2)"); + 'The value of result is expected to be ["9007199254740989", "9007199254740990"]'); var result = Array.prototype.slice.call(proxy, -2, -1); assert.compareArray(result, ["9007199254740989"], - "slice(-2, -1)"); + 'The value of result is expected to be ["9007199254740989"]'); diff --git a/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit.js b/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit.js index d3b4292881..7adf639c7b 100644 --- a/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit.js +++ b/test/built-ins/Array/prototype/slice/length-exceeding-integer-limit.js @@ -28,20 +28,20 @@ var arrayLike = { var result = Array.prototype.slice.call(arrayLike, 9007199254740989); assert.compareArray(result, ["9007199254740989", "9007199254740990"], - "slice(9007199254740989)"); + 'The value of result is expected to be ["9007199254740989", "9007199254740990"]'); var result = Array.prototype.slice.call(arrayLike, 9007199254740989, 9007199254740990); assert.compareArray(result, ["9007199254740989"], - "slice(9007199254740989, 9007199254740990)"); + 'The value of result is expected to be ["9007199254740989"]'); var result = Array.prototype.slice.call(arrayLike, 9007199254740989, 9007199254740996); assert.compareArray(result, ["9007199254740989", "9007199254740990"], - "slice(9007199254740989, 9007199254740996)"); + 'The value of result is expected to be ["9007199254740989", "9007199254740990"]'); var result = Array.prototype.slice.call(arrayLike, -2); assert.compareArray(result, ["9007199254740989", "9007199254740990"], - "slice(-2)"); + 'The value of result is expected to be ["9007199254740989", "9007199254740990"]'); var result = Array.prototype.slice.call(arrayLike, -2, -1); assert.compareArray(result, ["9007199254740989"], - "slice(-2, -1)"); + 'The value of result is expected to be ["9007199254740989"]'); diff --git a/test/built-ins/Array/prototype/splice/create-species-length-exceeding-integer-limit.js b/test/built-ins/Array/prototype/splice/create-species-length-exceeding-integer-limit.js index f0a5d73ed5..2efecc76b7 100644 --- a/test/built-ins/Array/prototype/splice/create-species-length-exceeding-integer-limit.js +++ b/test/built-ins/Array/prototype/splice/create-species-length-exceeding-integer-limit.js @@ -67,10 +67,10 @@ var target = new Proxy([], allowProxyTraps({ assert.throws(StopSplice, function() { // deleteCount argument exceeding 2^53-1. Array.prototype.splice.call(source, 0, 2 ** 53 + 4); -}); +}, '// deleteCount argument exceeding 2^53-1. Array.prototype.splice.call(source, 0, 2 ** 53 + 4) throws a StopSplice exception'); assert.sameValue(targetLength, 2 ** 53 - 1, - "length and deleteCount were correctly clamped to 2^53-1"); + 'The value of targetLength is expected to be 2 ** 53 - 1'); assert.compareArray(traps, [ "source.[[Get]]:length", @@ -86,4 +86,4 @@ assert.compareArray(traps, [ "source.[[Has]]:2", "source.[[Get]]:2", "target.[[DefineProperty]]:2", -]); +], 'The value of traps is expected to be [\n "source.[[Get]]:length",\n\n "source.[[Get]]:constructor",\n\n "source.[[Has]]:0",\n "source.[[Get]]:0",\n "target.[[DefineProperty]]:0",\n\n "source.[[Has]]:1",\n\n "source.[[Has]]:2",\n "source.[[Get]]:2",\n "target.[[DefineProperty]]:2",\n]'); diff --git a/test/built-ins/Array/prototype/splice/length-and-deleteCount-exceeding-integer-limit.js b/test/built-ins/Array/prototype/splice/length-and-deleteCount-exceeding-integer-limit.js index 7734bb325a..3c68671237 100644 --- a/test/built-ins/Array/prototype/splice/length-and-deleteCount-exceeding-integer-limit.js +++ b/test/built-ins/Array/prototype/splice/length-and-deleteCount-exceeding-integer-limit.js @@ -36,19 +36,19 @@ var arrayLike = { var result = Array.prototype.splice.call(arrayLike, 9007199254740989, 2 ** 53 + 4); assert.compareArray(result, ["9007199254740989", "9007199254740990"], - "arrayLike['9007199254740989'] and arrayLike['9007199254740990'] are removed"); + 'The value of result is expected to be ["9007199254740989", "9007199254740990"]'); assert.sameValue(arrayLike.length, 2 ** 53 - 3, - "New length is 2**53 - 3"); + 'The value of arrayLike.length is expected to be 2 ** 53 - 3'); assert.sameValue(arrayLike["9007199254740988"], "9007199254740988", - "arrayLike['9007199254740988'] is unchanged"); + 'The value of arrayLike["9007199254740988"] is expected to be "9007199254740988"'); assert.sameValue("9007199254740989" in arrayLike, false, - "arrayLike['9007199254740989'] is removed"); + 'The result of evaluating ("9007199254740989" in arrayLike) is expected to be false'); assert.sameValue("9007199254740990" in arrayLike, false, - "arrayLike['9007199254740990'] is removed"); + 'The result of evaluating ("9007199254740990" in arrayLike) is expected to be false'); assert.sameValue(arrayLike["9007199254740991"], "9007199254740991", - "arrayLike['9007199254740991'] is unchanged"); + 'The value of arrayLike["9007199254740991"] is expected to be "9007199254740991"'); diff --git a/test/built-ins/Array/prototype/splice/length-exceeding-integer-limit-shrink-array.js b/test/built-ins/Array/prototype/splice/length-exceeding-integer-limit-shrink-array.js index 8340b6a29e..46a59a25f2 100644 --- a/test/built-ins/Array/prototype/splice/length-exceeding-integer-limit-shrink-array.js +++ b/test/built-ins/Array/prototype/splice/length-exceeding-integer-limit-shrink-array.js @@ -40,25 +40,25 @@ var arrayLike = { var result = Array.prototype.splice.call(arrayLike, 9007199254740987, 1); assert.compareArray(result, ["9007199254740987"], - "arrayLike['9007199254740987'] is removed"); + 'The value of result is expected to be ["9007199254740987"]'); assert.sameValue(arrayLike.length, 2 ** 53 - 2, - "New length is 2**53 - 2"); + 'The value of arrayLike.length is expected to be 2 ** 53 - 2'); assert.sameValue(arrayLike["9007199254740986"], "9007199254740986", - "arrayLike['9007199254740986'] is unchanged"); + 'The value of arrayLike["9007199254740986"] is expected to be "9007199254740986"'); assert.sameValue(arrayLike["9007199254740987"], "9007199254740988", - "arrayLike['9007199254740988'] is moved to arrayLike['9007199254740987']"); + 'The value of arrayLike["9007199254740987"] is expected to be "9007199254740988"'); assert.sameValue("9007199254740988" in arrayLike, false, - "arrayLike['9007199254740990'] is removed"); + 'The result of evaluating ("9007199254740988" in arrayLike) is expected to be false'); assert.sameValue(arrayLike["9007199254740989"], "9007199254740990", - "arrayLike['9007199254740990'] is moved to arrayLike['9007199254740989']"); + 'The value of arrayLike["9007199254740989"] is expected to be "9007199254740990"'); assert.sameValue("9007199254740990" in arrayLike, false, - "arrayLike['9007199254740990'] is removed"); + 'The result of evaluating ("9007199254740990" in arrayLike) is expected to be false'); assert.sameValue(arrayLike["9007199254740991"], "9007199254740991", - "arrayLike['9007199254740991'] is unchanged"); + 'The value of arrayLike["9007199254740991"] is expected to be "9007199254740991"'); diff --git a/test/built-ins/Array/prototype/splice/length-near-integer-limit-grow-array.js b/test/built-ins/Array/prototype/splice/length-near-integer-limit-grow-array.js index 42cf6f9c50..a36b385a61 100644 --- a/test/built-ins/Array/prototype/splice/length-near-integer-limit-grow-array.js +++ b/test/built-ins/Array/prototype/splice/length-near-integer-limit-grow-array.js @@ -36,27 +36,27 @@ var arrayLike = { var result = Array.prototype.splice.call(arrayLike, 9007199254740986, 0, "new-value"); -assert.compareArray(result, [], "No elements are removed"); +assert.compareArray(result, [], 'The value of result is expected to be []'); -assert.sameValue(arrayLike.length, 2 ** 53 - 1, "New length is 2**53 - 1"); +assert.sameValue(arrayLike.length, 2 ** 53 - 1, 'The value of arrayLike.length is expected to be 2 ** 53 - 1'); assert.sameValue(arrayLike["9007199254740985"], "9007199254740985", - "arrayLike['9007199254740985'] is unchanged"); + 'The value of arrayLike["9007199254740985"] is expected to be "9007199254740985"'); assert.sameValue(arrayLike["9007199254740986"], "new-value", - "arrayLike['9007199254740986'] contains the inserted value"); + 'The value of arrayLike["9007199254740986"] is expected to be "new-value"'); assert.sameValue(arrayLike["9007199254740987"], "9007199254740986", - "arrayLike['9007199254740986'] is moved to arrayLike['9007199254740987']"); + 'The value of arrayLike["9007199254740987"] is expected to be "9007199254740986"'); assert.sameValue(arrayLike["9007199254740988"], "9007199254740987", - "arrayLike['9007199254740987'] is moved to arrayLike['9007199254740988']"); + 'The value of arrayLike["9007199254740988"] is expected to be "9007199254740987"'); assert.sameValue("9007199254740989" in arrayLike, false, - "arrayLike['9007199254740989'] is removed"); + 'The result of evaluating ("9007199254740989" in arrayLike) is expected to be false'); assert.sameValue(arrayLike["9007199254740990"], "9007199254740989", - "arrayLike['9007199254740989'] is moved to arrayLike['9007199254740990']"); + 'The value of arrayLike["9007199254740990"] is expected to be "9007199254740989"'); assert.sameValue(arrayLike["9007199254740991"], "9007199254740991", - "arrayLike['9007199254740991'] is unchanged"); + 'The value of arrayLike["9007199254740991"] is expected to be "9007199254740991"');