mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Merge pull request #17 from hankyates/array-fill-tests
* hankyates/array-fill-tests: Adding Array.prototype#fill tests
This commit is contained in:
commit
e09d62bba3
31
test/suite/es6/ch22/22.1/22.1.3/S22.1.3.6_T1.js
Normal file
31
test/suite/es6/ch22/22.1/22.1.3/S22.1.3.6_T1.js
Normal file
@ -0,0 +1,31 @@
|
||||
// Copyright (c) 2014 Hank Yates. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/**
|
||||
* @description Testing Array#fill
|
||||
* @author Hank Yates (hankyates@gmail.com)
|
||||
*/
|
||||
|
||||
runTestCase(function () {
|
||||
var testArr = new Array('testString', 'anotherTestString', 3),
|
||||
updatedArr = testArr.fill('newValue', 1, 3);
|
||||
|
||||
if (updatedArr[3] !== 'newValue') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (updatedArr[2] !== 'newValue') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (updatedArr[0] !== 'testString') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (updatedArr.length !== 4) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user