mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 06:25:30 +02:00
Add basic Symbol constructor tests (#1069)
* add Symbol.length test * add Symbol.name test * add global.Symbol test
This commit is contained in:
parent
e3fa66550f
commit
0d2b3562e9
18
test/built-ins/Symbol/length.js
Normal file
18
test/built-ins/Symbol/length.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (C) 2017 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-symbol-constructor
|
||||||
|
description: >
|
||||||
|
Properties of the Symbol Constructor
|
||||||
|
|
||||||
|
Besides the length property (whose value is 0)
|
||||||
|
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(Symbol.length, 0, "The value of `Symbol.length` is `0`");
|
||||||
|
|
||||||
|
verifyNotEnumerable(Symbol, "length");
|
||||||
|
verifyNotWritable(Symbol, "length");
|
||||||
|
verifyConfigurable(Symbol, "length");
|
16
test/built-ins/Symbol/name.js
Normal file
16
test/built-ins/Symbol/name.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) 2017 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-symbol-constructor
|
||||||
|
description: >
|
||||||
|
Symbol ( [ description ] )
|
||||||
|
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(Symbol.name, "Symbol", "The value of `Symbol.name` is `'Symbol'`");
|
||||||
|
|
||||||
|
verifyNotEnumerable(Symbol, "name");
|
||||||
|
verifyNotWritable(Symbol, "name");
|
||||||
|
verifyConfigurable(Symbol, "name");
|
15
test/built-ins/Symbol/symbol.js
Normal file
15
test/built-ins/Symbol/symbol.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// Copyright (C) 2017 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-symbol-constructor
|
||||||
|
description: >
|
||||||
|
The Symbol constructor is the %Symbol% intrinsic object and the initial
|
||||||
|
value of the Symbol property of the global object.
|
||||||
|
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
verifyNotEnumerable(this, "Symbol");
|
||||||
|
verifyWritable(this, "Symbol");
|
||||||
|
verifyConfigurable(this, "Symbol");
|
Loading…
x
Reference in New Issue
Block a user