mirror of https://github.com/tc39/test262.git
Add initial tests for trim(Start/End/Left/Right)
This commit is contained in:
parent
40a7bd2401
commit
5931e313fc
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
String.prototype.trimLeft.length is 0.
|
||||
info: >
|
||||
String.prototype.trimLeft ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this
|
||||
value is equal to the largest number of named arguments shown in the
|
||||
subclause headings for the function description, including optional
|
||||
parameters. However, rest parameters shown using the form “...name”
|
||||
are not included in the default argument count.
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(String.prototype.trimLeft.length, 0);
|
||||
|
||||
verifyNotEnumerable(String.prototype.trimLeft, "length");
|
||||
verifyNotWritable(String.prototype.trimLeft, "length");
|
||||
verifyConfigurable(String.prototype.trimLeft, "length");
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
String.prototype.trimLeft.name is "trimLeft".
|
||||
info: >
|
||||
String.prototype.trimLeft ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value
|
||||
is a String.
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(String.prototype.trimLeft.name, "valueOf");
|
||||
|
||||
verifyNotEnumerable(String.prototype.trimLeft, "name");
|
||||
verifyNotWritable(String.prototype.trimLeft, "name");
|
||||
verifyConfigurable(String.prototype.trimLeft, "name");
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2017 The Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
"trimLeft" property of String.prototype
|
||||
info: >
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(String.prototype, "trimLeft");
|
||||
verifyWritable(String.prototype, "trimLeft");
|
||||
verifyConfigurable(String.prototype, "trimLeft);
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
String.prototype.trimRight.length is 0.
|
||||
info: >
|
||||
String.prototype.trimRight ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this
|
||||
value is equal to the largest number of named arguments shown in the
|
||||
subclause headings for the function description, including optional
|
||||
parameters. However, rest parameters shown using the form “...name”
|
||||
are not included in the default argument count.
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(String.prototype.trimRight.length, 0);
|
||||
|
||||
verifyNotEnumerable(String.prototype.trimRight, "length");
|
||||
verifyNotWritable(String.prototype.trimRight, "length");
|
||||
verifyConfigurable(String.prototype.trimRight, "length");
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
String.prototype.trimRight.name is "trimRight".
|
||||
info: >
|
||||
String.prototype.trimRight ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value
|
||||
is a String.
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(String.prototype.trimRight.name, "valueOf");
|
||||
|
||||
verifyNotEnumerable(String.prototype.trimRight, "name");
|
||||
verifyNotWritable(String.prototype.trimRight, "name");
|
||||
verifyConfigurable(String.prototype.trimRight, "name");
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2017 The Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
"trimRight" property of String.prototype
|
||||
info: >
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(String.prototype, "trimRight");
|
||||
verifyWritable(String.prototype, "trimRight");
|
||||
verifyConfigurable(String.prototype, "trimRight);
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
String.prototype.trimEnd.length is 0.
|
||||
info: >
|
||||
String.prototype.trimEnd ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this
|
||||
value is equal to the largest number of named arguments shown in the
|
||||
subclause headings for the function description, including optional
|
||||
parameters. However, rest parameters shown using the form “...name”
|
||||
are not included in the default argument count.
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(String.prototype.trimEnd.length, 0);
|
||||
|
||||
verifyNotEnumerable(String.prototype.trimEnd, "length");
|
||||
verifyNotWritable(String.prototype.trimEnd, "length");
|
||||
verifyConfigurable(String.prototype.trimEnd, "length");
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
String.prototype.trimEnd.name is "trimEnd".
|
||||
info: >
|
||||
String.prototype.trimEnd ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value
|
||||
is a String.
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(String.prototype.trimEnd.name, "valueOf");
|
||||
|
||||
verifyNotEnumerable(String.prototype.trimEnd, "name");
|
||||
verifyNotWritable(String.prototype.trimEnd, "name");
|
||||
verifyConfigurable(String.prototype.trimEnd, "name");
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2017 The Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
"trimEnd" property of String.prototype
|
||||
info: >
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(String.prototype, "trimEnd");
|
||||
verifyWritable(String.prototype, "trimEnd");
|
||||
verifyConfigurable(String.prototype, "trimEnd");
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
String.prototype.trimStart.length is 0.
|
||||
info: >
|
||||
String.prototype.trimStart ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, has a length
|
||||
property whose value is an integer. Unless otherwise specified, this
|
||||
value is equal to the largest number of named arguments shown in the
|
||||
subclause headings for the function description, including optional
|
||||
parameters. However, rest parameters shown using the form “...name”
|
||||
are not included in the default argument count.
|
||||
|
||||
Unless otherwise specified, the length property of a built-in Function
|
||||
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
|
||||
[[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(String.prototype.trimStart.length, 0);
|
||||
|
||||
verifyNotEnumerable(String.prototype.trimStart, "length");
|
||||
verifyNotWritable(String.prototype.trimStart, "length");
|
||||
verifyConfigurable(String.prototype.trimStart, "length");
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
String.prototype.trimStart.name is "trimStart".
|
||||
info: >
|
||||
String.prototype.trimStart ( )
|
||||
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
Every built-in Function object, including constructors, that is not
|
||||
identified as an anonymous function has a name property whose value
|
||||
is a String.
|
||||
|
||||
Unless otherwise specified, the name property of a built-in Function
|
||||
object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(String.prototype.trimStart.name, "valueOf");
|
||||
|
||||
verifyNotEnumerable(String.prototype.trimStart, "name");
|
||||
verifyNotWritable(String.prototype.trimStart, "name");
|
||||
verifyConfigurable(String.prototype.trimStart, "name");
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2017 The Valerie Young. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
"trimStart" property of String.prototype
|
||||
info: >
|
||||
17 ECMAScript Standard Built-in Objects:
|
||||
|
||||
Every other data property described in clauses 18 through 26 and in Annex B.2
|
||||
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
|
||||
[[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(String.prototype, "trimStart");
|
||||
verifyWritable(String.prototype, "trimStart");
|
||||
verifyConfigurable(String.prototype, "trimStart");
|
Loading…
Reference in New Issue