mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Merge pull request #11 from hankyates/array-of-tests
* hankyates/array-of-tests: Adding Array#of tests
This commit is contained in:
commit
382b844b23
22
test/suite/es6/ch22/22.1/22.1.2/S22.1.2.3_T1.js
Normal file
22
test/suite/es6/ch22/22.1/22.1.2/S22.1.2.3_T1.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (c) 2014 Hank Yates. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
//
|
||||||
|
/**
|
||||||
|
* @description Testing Array#of when passed Strings
|
||||||
|
* @author Hank Yates (hankyates@gmail.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
runTestCase(function () {
|
||||||
|
var testArr = Array.of('testString', 'anotherTestString');
|
||||||
|
|
||||||
|
if (testArr[0] !== 'testString') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (testArr[1] !== 'anotherTestString') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
});
|
21
test/suite/es6/ch22/22.1/22.1.2/S22.1.2.3_T2.js
Normal file
21
test/suite/es6/ch22/22.1/22.1.2/S22.1.2.3_T2.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
// Copyright (c) 2014 Hank Yates. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/**
|
||||||
|
* @description Testing Array#of when passed single argument
|
||||||
|
* @author Hank Yates (hankyates@gmail.com)
|
||||||
|
*/
|
||||||
|
|
||||||
|
runTestCase(function () {
|
||||||
|
var testArr = Array.of(3);
|
||||||
|
|
||||||
|
if (testArr.length !== 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (testArr[0] !== 3) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user