From cae283b563a6996e754e525c10b6f5fcbf054bf0 Mon Sep 17 00:00:00 2001 From: Hank Yates <hankyates@gmail.com> Date: Sun, 26 Jan 2014 16:48:37 -0800 Subject: [PATCH] Adding Array.prototype#fill tests --- .../es6/ch22/22.1/22.1.3/S22.1.3.6_T1.js | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/suite/es6/ch22/22.1/22.1.3/S22.1.3.6_T1.js diff --git a/test/suite/es6/ch22/22.1/22.1.3/S22.1.3.6_T1.js b/test/suite/es6/ch22/22.1/22.1.3/S22.1.3.6_T1.js new file mode 100644 index 0000000000..755722da6c --- /dev/null +++ b/test/suite/es6/ch22/22.1/22.1.3/S22.1.3.6_T1.js @@ -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; + +}); -- GitLab