diff --git a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js index 29a901f9e1a88517dea5490fd31a7876f2e4e90b..b50e116031e49902f98a580aa11f838a3f42be0c 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js @@ -37,6 +37,14 @@ testWithTypedArrayConstructors(function(TA) { '[0, 1, 2, 3].copyWithin(0, 1, -10) -> [0, 1, 2, 3]' ); + assert( + compareArray( + new TA([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( new TA([0, 1, 2, 3]).copyWithin(0, -2, -10), @@ -45,6 +53,14 @@ testWithTypedArrayConstructors(function(TA) { '[0, 1, 2, 3].copyWithin(0, -2, -10) -> [0, 1, 2, 3]' ); + assert( + compareArray( + new TA([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( new TA([0, 1, 2, 3]).copyWithin(0, -9, -10), @@ -53,6 +69,14 @@ testWithTypedArrayConstructors(function(TA) { '[0, 1, 2, 3].copyWithin(0, -9, -10) -> [0, 1, 2, 3]' ); + assert( + compareArray( + new TA([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( new TA([0, 1, 2, 3]).copyWithin(-3, -2, -10), @@ -61,6 +85,14 @@ testWithTypedArrayConstructors(function(TA) { '[0, 1, 2, 3].copyWithin(-3, -2, -10) -> [0, 1, 2, 3]' ); + assert( + compareArray( + new TA([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( new TA([0, 1, 2, 3]).copyWithin(-7, -8, -9), @@ -68,4 +100,12 @@ testWithTypedArrayConstructors(function(TA) { ), '[0, 1, 2, 3].copyWithin(-7, -8, -9) -> [0, 1, 2, 3]' ); + + assert( + compareArray( + new TA([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]' + ); }); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js index 4c1a258ef59155b91c9f414bda620a100bccaf99..af9341165f5da7d77252fe13395478fdca874edb 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js @@ -35,6 +35,14 @@ testWithTypedArrayConstructors(function(TA) { '[0, 1, 2, 3]).copyWithin(0, -10) -> [0, 1, 2, 3]' ); + assert( + compareArray( + new TA([1, 2, 3, 4, 5]).copyWithin(0, -Infinity), + [0, 1, 2, 3] + ), + '[1, 2, 3, 4, 5]).copyWithin(0, -Infinity) -> [1, 2, 3, 4, 5]' + ); + assert( compareArray( new TA([0, 1, 2, 3, 4]).copyWithin(2, -10), @@ -43,6 +51,14 @@ testWithTypedArrayConstructors(function(TA) { '[0, 1, 2, 3, 4]).copyWithin(2, -2) -> [0, 1, 0, 1, 2]' ); + assert( + compareArray( + new TA([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( new TA([0, 1, 2, 3, 4]).copyWithin(10, -10), @@ -51,6 +67,14 @@ testWithTypedArrayConstructors(function(TA) { '[0, 1, 2, 3, 4]).copyWithin(10, -10) -> [0, 1, 2, 3, 4]' ); + assert( + compareArray( + new TA([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( new TA([0, 1, 2, 3]).copyWithin(-9, -10), @@ -58,4 +82,12 @@ testWithTypedArrayConstructors(function(TA) { ), '[0, 1, 2, 3].copyWithin(-9, -10) -> [0, 1, 2, 3]' ); + + assert( + compareArray( + new TA([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]' + ); }); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js index bb27644bfd8375bb70a06db46571ed44fa39c126..ed074fd896745df4a800d79b3b0b8f9f45e8c70a 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js @@ -35,6 +35,14 @@ testWithTypedArrayConstructors(function(TA) { '[0, 1, 2, 3].copyWithin(-10, 0) -> [0, 1, 2, 3]' ); + assert( + compareArray( + new TA([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( new TA([0, 1, 2, 3, 4]).copyWithin(-10, 2), @@ -42,4 +50,12 @@ testWithTypedArrayConstructors(function(TA) { ), '[0, 1, 2, 3, 4].copyWithin(-10, 2) -> [2, 3, 4, 3, 4]' ); + + assert( + compareArray( + new TA([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]' + ); }); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js index f5f1b77bbc03bb9d24e4f6df0d003caa64147d2b..e681e282d017c4d61b61df14659ab88e835c455b 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js @@ -28,6 +28,14 @@ testWithTypedArrayConstructors(function(TA) { '[0, 1, 2, 3].copyWithin(0, 1, 6) -> [1, 2, 3, 3]' ); + assert( + compareArray( + new TA([1, 2, 3, 4, 5]).copyWithin(0, 1, Infinity), + [2, 3, 4, 5, 5] + ), + '[1, 2, 3, 4, 5].copyWithin(0, 1, Infinity) -> [2, 3, 4, 5, 5]' + ); + assert( compareArray( new TA([0, 1, 2, 3, 4, 5]).copyWithin(1, 3, 6), @@ -35,4 +43,12 @@ testWithTypedArrayConstructors(function(TA) { ), '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6) -> [0, 3, 4, 5, 4, 5]' ); + + assert( + compareArray( + new TA([1, 2, 3, 4, 5]).copyWithin(1, 3, Infinity), + [1, 4, 5, 4, 5] + ), + '[1, 2, 3, 4, 5].copyWithin(1, 3, Infinity) -> [1, 4, 5, 4, 5]' + ); }); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js index 6fc8351a5d0230c229d20ba667a49657aef3b9a3..c0e022ccd283a24c88484f0888827561e2cbe71f 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js @@ -27,6 +27,14 @@ testWithTypedArrayConstructors(function(TA) { ) ); + assert( + compareArray( + new TA([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( new TA([0, 1, 2, 3, 4, 5]).copyWithin(0, 6), @@ -34,6 +42,14 @@ testWithTypedArrayConstructors(function(TA) { ) ); + assert( + compareArray( + new TA([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( new TA([0, 1, 2, 3, 4, 5]).copyWithin(6, 6), @@ -47,4 +63,12 @@ testWithTypedArrayConstructors(function(TA) { [0, 1, 2, 3, 4, 5] ) ); + + assert( + compareArray( + new TA([1, 2, 3, 4, 5]).copyWithin(Infinity, Infinity), + [1, 2, 3, 4, 5] + ), + '[1, 2, 3, 4, 5].copyWithin(Infinity, Infinity) -> [1, 2, 3, 4, 5]' + ); });