-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add number tests for trim(Start/End)
- Loading branch information
Valerie R Young
committed
Sep 29, 2017
1 parent
4587c81
commit c13978c
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
test/built-ins/String/prototype/trimEnd/this-value-number.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) 2017 Valerie Young. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-string.prototype.trimEnd | ||
description: Behavoir when "this" value is a number. | ||
info: | | ||
TrimString | ||
2. Let S be ? ToString(str). | ||
ToString | ||
Argument Type: Number | ||
Result: NumberToString(argument) | ||
features: [string-trimming] | ||
---*/ | ||
|
||
var trimEnd = String.prototype.trimEnd | ||
|
||
assert.sameValue( | ||
trimEnd.call(NaN), | ||
'NaN', | ||
'String.prototype.trimEnd.call(NaN)' | ||
); | ||
|
||
assert.sameValue( | ||
trimEnd.call(Infinity), | ||
'Infinity', | ||
'String.prototype.trimEnd.call(Infinity)' | ||
); | ||
|
||
assert.sameValue( | ||
trimEnd.call(-0), | ||
'0', | ||
'String.prototype.trimEnd.call(-0)' | ||
); | ||
|
||
assert.sameValue( | ||
trimEnd.call(1), | ||
'1', | ||
'String.prototype.trimEnd.call(1)' | ||
); | ||
|
||
assert.sameValue( | ||
trimEnd.call(-1), | ||
'-1', | ||
'String.prototype.trimEnd.call(-1)' | ||
); | ||
|
48 changes: 48 additions & 0 deletions
48
test/built-ins/String/prototype/trimStart/this-value-number.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) 2017 Valerie Young. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-string.prototype.trimStart | ||
description: Behavoir when "this" value is a number. | ||
info: | | ||
TrimString | ||
2. Let S be ? ToString(str). | ||
ToString | ||
Argument Type: Number | ||
Result: NumberToString(argument) | ||
features: [string-trimming] | ||
---*/ | ||
|
||
var trimStart = String.prototype.trimStart | ||
|
||
assert.sameValue( | ||
trimStart.call(NaN), | ||
'NaN', | ||
'String.prototype.trimStart.call(NaN)' | ||
); | ||
|
||
assert.sameValue( | ||
trimStart.call(Infinity), | ||
'Infinity', | ||
'String.prototype.trimStart.call(Infinity)' | ||
); | ||
|
||
assert.sameValue( | ||
trimStart.call(-0), | ||
'0', | ||
'String.prototype.trimStart.call(-0)' | ||
); | ||
|
||
assert.sameValue( | ||
trimStart.call(1), | ||
'1', | ||
'String.prototype.trimStart.call(1)' | ||
); | ||
|
||
assert.sameValue( | ||
trimStart.call(-1), | ||
'-1', | ||
'String.prototype.trimStart.call(-1)' | ||
); | ||
|