Add boolean/Symbol() tests for trim(Start/End)

This commit is contained in:
Valerie R Young 2017-09-25 17:53:43 -04:00 committed by Rick Waldron
parent 3f42003974
commit 0c796ea88b
4 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,21 @@
// Copyright (c) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: pending
description: Behavoir when "this" value is a boolean.
---*/
var trimStart = String.prototype.trimStart
assert.sameValue(
trimStart.call(true),
'true',
'String.prototype.trimStart.call(true)'
);
assert.sameValue(
String.prototype.trimStart.call(false),
'false',
'String.prototype.trimStart.call(false)'
);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: pending
description: Type error when "this" value is a Symbol
info: |
TrimString
2. Let S be ? ToString(str).
ToString
Argument Type: Symbol
Result: Throw a TypeError exception
---*/
var trimEnd = String.prototype.trimEnd;
var symbol = Symbol()
assert.throws(TypeError, function() {
trimEnd.call(symbol);
}, 'Symbol()');

View File

@ -0,0 +1,21 @@
// Copyright (c) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: pending
description: Behavoir when "this" value is a boolean.
---*/
var trimStart = String.prototype.trimStart
assert.sameValue(
trimStart.call(true),
'true',
'String.prototype.trimStart.call(true)'
);
assert.sameValue(
String.prototype.trimStart.call(false),
'false',
'String.prototype.trimStart.call(false)'
);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: pending
description: Type error when "this" value is a Symbol
info: |
TrimString
2. Let S be ? ToString(str).
ToString
Argument Type: Symbol
Result: Throw a TypeError exception
---*/
var trimStart = String.prototype.trimStart;
var symbol = Symbol()
assert.throws(TypeError, function() {
trimStart.call(symbol);
}, 'Symbol()');