Replace runTestCase with assert helpers [test/built-ins/String]

This commit is contained in:
André Bargull 2015-08-06 18:23:58 +02:00
parent ce98c25647
commit b1ecdd00e8
96 changed files with 125 additions and 635 deletions

View File

@ -9,15 +9,10 @@ es5id: 15.5.5.5.2-1-1
description: >
String object supports bracket notation to lookup of data
properties
includes: [runTestCase.js]
---*/
function testcase() {
var s = new String("hello world");
s.foo = 1;
if (s["foo"] === 1) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s["foo"], 1, 's["foo"]');

View File

@ -7,14 +7,9 @@ info: >
notation to look up non numeric property names.
es5id: 15.5.5.5.2-1-2
description: String value supports bracket notation to lookup data properties
includes: [runTestCase.js]
---*/
function testcase() {
var s = String("hello world");
if (s["foo"] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s["foo"], undefined, 's["foo"]');

View File

@ -9,14 +9,9 @@ es5id: 15.5.5.5.2-3-1
description: >
String object indexing returns undefined for missing data
properties
includes: [runTestCase.js]
---*/
function testcase() {
var s = new String("hello world");
if (s["foo"] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s["foo"], undefined, 's["foo"]');

View File

@ -7,14 +7,9 @@ info: >
notation to look up non numeric property names.
es5id: 15.5.5.5.2-3-2
description: String value indexing returns undefined for missing data properties
includes: [runTestCase.js]
---*/
function testcase() {
var s = String("hello world");
if (s["foo"] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s["foo"], undefined, 's["foo"]');

View File

@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-3
description: >
String object indexing returns undefined if the numeric index
(NaN) is not an array index
includes: [runTestCase.js]
---*/
function testcase() {
var s = new String("hello world");
if (s[NaN] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s[NaN], undefined, 's[NaN]');

View File

@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-4
description: >
String object indexing returns undefined if the numeric index
(Infinity) is not an array index
includes: [runTestCase.js]
---*/
function testcase() {
var s = new String("hello world");
if (s[Infinity] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s[Infinity], undefined, 's[Infinity]');

View File

@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-5
description: >
String object indexing returns undefined if the numeric index (
2^32-1) is not an array index
includes: [runTestCase.js]
---*/
function testcase() {
var s = new String("hello world");
if (s[Math.pow(2, 32)-1]===undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s[Math.pow(2, 32)-1], undefined, 's[Math.pow(2, 32)-1]');

View File

@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-6
description: >
String value indexing returns undefined if the numeric index (NaN)
is not an array index
includes: [runTestCase.js]
---*/
function testcase() {
var s = String("hello world");
if (s[NaN] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s[NaN], undefined, 's[NaN]');

View File

@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-7
description: >
String value indexing returns undefined if the numeric index
(Infinity) is not an array index
includes: [runTestCase.js]
---*/
function testcase() {
var s = String("hello world");
if (s[Infinity] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s[Infinity], undefined, 's[Infinity]');

View File

@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-8
description: >
String value indexing returns undefined if the numeric index ( >=
2^32-1) is not an array index
includes: [runTestCase.js]
---*/
function testcase() {
var s = String("hello world");
if (s[Math.pow(2, 32)-1]===undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s[Math.pow(2, 32)-1], undefined, 's[Math.pow(2, 32)-1]');

View File

@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-7-1
description: >
String object indexing returns undefined if the numeric index is
less than 0
includes: [runTestCase.js]
---*/
function testcase() {
var s = new String("hello world");
if (s[-1] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s[-1], undefined, 's[-1]');

View File

@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-7-2
description: >
String value indexing returns undefined if the numeric index is
less than 0
includes: [runTestCase.js]
---*/
function testcase() {
var s = String("hello world");
if (s[-1] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s[-1], undefined, 's[-1]');

View File

@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-7-3
description: >
String object indexing returns undefined if the numeric index is
greater than the string length
includes: [runTestCase.js]
---*/
function testcase() {
var s = new String("hello world");
if (s[11] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s[11], undefined, 's[11]');

View File

@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-7-4
description: >
String value indexing returns undefined if the numeric index is
greater than the string length
includes: [runTestCase.js]
---*/
function testcase() {
var s = String("hello world");
if (s[11] === undefined) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s[11], undefined, 's[11]');

View File

@ -4,13 +4,7 @@
/*---
author: Ryan Lewis
description: endsWith should return false when called on 'word' and passed 'r'.
includes: [runTestCase.js]
features: [String#endsWith]
---*/
function testcase() {
if('word'.endsWith('r') === false) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.endsWith('r'), false, '"word".endsWith("r")');

View File

@ -6,13 +6,7 @@ author: Ryan Lewis
description: >
endsWith should return false when called on 'word' and passed 'd',
with an endPosition of 3.
includes: [runTestCase.js]
features: [String#endsWith]
---*/
function testcase() {
if('word'.endsWith('d', 3) === false) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.endsWith('d', 3), false, '"word".endsWith("d", 3)');

View File

@ -6,13 +6,7 @@ author: Ryan Lewis
description: >
endsWith should return true when called on 'word' and passed 'd'
and with no endPosition (defaults to 4).
includes: [runTestCase.js]
features: [String#endsWith]
---*/
function testcase() {
if('word'.endsWith('d') === true) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.endsWith('d'), true, '"word".endsWith("d")');

View File

@ -6,13 +6,7 @@ author: Ryan Lewis
description: >
endsWith should return true when called on 'word' and passed 'd'
and with an endPosition of 4.
includes: [runTestCase.js]
features: [String#endsWith]
---*/
function testcase() {
if('word'.endsWith('d', 4) === true) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.endsWith('d', 4), true, '"word".endsWith("d", 4)');

View File

@ -6,13 +6,7 @@ author: Ryan Lewis
description: >
endsWith should return true when called on 'word' and passed 'd'
and with an endPosition of 25.
includes: [runTestCase.js]
features: [String#endsWith]
---*/
function testcase() {
if('word'.endsWith('d', 25) === true) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.endsWith('d', 25), true, '"word".endsWith("d", 25)');

View File

@ -6,13 +6,7 @@ author: Ryan Lewis
description: >
endsWith should return true when called on 'word' and passed 'r',
with an endPosition of 3.
includes: [runTestCase.js]
features: [String#endsWith]
---*/
function testcase() {
if('word'.endsWith('r', 3) === true) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.endsWith('r', 3), true, '"word".endsWith("r", 3)');

View File

@ -6,13 +6,7 @@ author: Ryan Lewis
description: >
String should return false if a location is passed that is
greather than the length of the string.
includes: [runTestCase.js]
features: [String#includes]
---*/
function testcase() {
if('word'.includes('w', 5) === false) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.includes('w', 5), false, '"word".includes("w", 5)');

View File

@ -6,13 +6,7 @@ author: Ryan Lewis
description: >
String should return false if a letter is not found in the word
starting from the passed location.
includes: [runTestCase.js]
features: [String#includes]
---*/
function testcase() {
if('word'.includes('o', 3) === false) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.includes('o', 3), false, '"word".includes("o", 3)');

View File

@ -4,13 +4,7 @@
/*---
author: Ryan Lewis
description: String should return false if a letter is not found in the word.
includes: [runTestCase.js]
features: [String#includes]
---*/
function testcase() {
if('word'.includes('a', 0) === false) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.includes('a', 0), false, '"word".includes("a", 0)');

View File

@ -6,13 +6,7 @@ author: Ryan Lewis
description: >
String should return true when called on 'word' and passed 'w' and
the location 0.
includes: [runTestCase.js]
features: [String#includes]
---*/
function testcase() {
if('word'.includes('w', 0) === true) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.includes('w', 0), true, '"word".includes("w", 0)');

View File

@ -6,13 +6,7 @@ author: Ryan Lewis
description: >
String should return true when called on 'word' and passed 'w' and
with no location (defaults to 0).
includes: [runTestCase.js]
features: [String#includes]
---*/
function testcase() {
if('word'.includes('w') === true) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.includes('w'), true, '"word".includes("w")');

View File

@ -4,13 +4,7 @@
/*---
author: Ryan Lewis
description: String should have the property length with size of 1.
includes: [runTestCase.js]
features: [String#includes]
---*/
function testcase() {
if('word'.includes.length === 1) {
return true;
}
}
runTestCase(testcase);
assert.sameValue('word'.includes.length, 1, '"word".includes.length');

View File

@ -7,12 +7,9 @@ description: >
'this' object used by the replaceValue function of a
String.prototype.replace invocation
flags: [noStrict]
includes:
- runTestCase.js
- fnGlobalObject.js
includes: [fnGlobalObject.js]
---*/
function testcase() {
var retVal = 'x'.replace(/x/,
function() {
if (this===fnGlobalObject()) {
@ -21,6 +18,5 @@ function testcase() {
return 'z';
}
});
return retVal==='y';
}
runTestCase(testcase);
assert.sameValue(retVal, 'y', 'retVal');

View File

@ -4,13 +4,8 @@
/*---
es5id: 15.5.4.20-0-1
description: String.prototype.trim must exist as a function
includes: [runTestCase.js]
---*/
function testcase() {
var f = String.prototype.trim;
if (typeof(f) === "function") {
return true;
}
}
runTestCase(testcase);
assert.sameValue(typeof(f), "function", 'typeof(f)');

View File

@ -4,12 +4,6 @@
/*---
es5id: 15.5.4.20-0-2
description: String.prototype.trim must exist as a function taking 0 parameters
includes: [runTestCase.js]
---*/
function testcase() {
if (String.prototype.trim.length === 0) {
return true;
}
}
runTestCase(testcase);
assert.sameValue(String.prototype.trim.length, 0, 'String.prototype.trim.length');

View File

@ -6,11 +6,9 @@ es5id: 15.5.4.20-1-8
description: >
String.prototype.trim works for a primitive string (value is '
abc')
includes: [runTestCase.js]
---*/
function testcase() {
var strObj = String(" abc");
return "abc" === strObj.trim() && strObj.toString() === " abc";
}
runTestCase(testcase);
assert.sameValue(strObj.trim(), "abc", 'strObj.trim()');
assert.sameValue(strObj.toString(), " abc", 'strObj.toString()');

View File

@ -6,11 +6,8 @@ es5id: 15.5.4.20-1-9
description: >
String.prototype.trim works for a String object which value is
undefined
includes: [runTestCase.js]
---*/
function testcase() {
var strObj = new String(undefined);
return strObj.trim() === "undefined";
}
runTestCase(testcase);
assert.sameValue(strObj.trim(), "undefined", 'strObj.trim()');

View File

@ -6,16 +6,12 @@ es5id: 15.5.4.20-2-38
description: >
String.prototype.trim - 'this' is an object which has an own
toString method
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {
toString: function () {
return "abc";
}
};
return (String.prototype.trim.call(obj) === "abc");
}
runTestCase(testcase);
assert.sameValue(String.prototype.trim.call(obj), "abc", 'String.prototype.trim.call(obj)');

View File

@ -6,16 +6,12 @@ es5id: 15.5.4.20-2-39
description: >
String.prototype.trim - 'this' is an object which has an own
valueOf method
includes: [runTestCase.js]
---*/
function testcase() {
var obj = {
valueOf: function () {
return "abc";
}
};
return (String.prototype.trim.call(obj) === "[object Object]");
}
runTestCase(testcase);
assert.sameValue(String.prototype.trim.call(obj), "[object Object]", 'String.prototype.trim.call(obj)');

View File

@ -7,10 +7,8 @@ description: >
String.prototype.trim - 'this' is an object that has an own
toString method that returns an object and valueOf method that
returns a primitive value
includes: [runTestCase.js]
---*/
function testcase() {
var toStringAccessed = false;
var valueOfAccessed = false;
var obj = {
@ -23,6 +21,7 @@ function testcase() {
return "abc";
}
};
return (String.prototype.trim.call(obj) === "abc") && valueOfAccessed && toStringAccessed;
}
runTestCase(testcase);
assert.sameValue(String.prototype.trim.call(obj), "abc", 'String.prototype.trim.call(obj)');
assert(valueOfAccessed, 'valueOfAccessed !== true');
assert(toStringAccessed, 'toStringAccessed !== true');

View File

@ -6,10 +6,8 @@ es5id: 15.5.4.20-2-41
description: >
String.prototype.trim - 'this' is an object which has an own
toString and valueOf method.
includes: [runTestCase.js]
---*/
function testcase() {
var toStringAccessed = false;
var valueOfAccessed = false;
var obj = {
@ -22,6 +20,7 @@ function testcase() {
return "cef";
}
};
return (String.prototype.trim.call(obj) === "abc") && !valueOfAccessed && toStringAccessed;
}
runTestCase(testcase);
assert.sameValue(String.prototype.trim.call(obj), "abc", 'String.prototype.trim.call(obj)');
assert.sameValue(valueOfAccessed, false, 'valueOfAccessed');
assert(toStringAccessed, 'toStringAccessed !== true');

View File

@ -7,11 +7,8 @@ description: >
String.prototype.trim - 'this' is an object with an own valueOf
and inherited toString methods with hint string, verify inherited
toString method will be called first
includes: [runTestCase.js]
---*/
function testcase() {
var toStringAccessed = false;
var valueOfAccessed = false;
@ -30,6 +27,7 @@ function testcase() {
valueOfAccessed = true;
return "efg";
};
return (String.prototype.trim.call(child) === "abc") && toStringAccessed && !valueOfAccessed;
}
runTestCase(testcase);
assert.sameValue(String.prototype.trim.call(child), "abc", 'String.prototype.trim.call(child)');
assert(toStringAccessed, 'toStringAccessed !== true');
assert.sameValue(valueOfAccessed, false, 'valueOfAccessed');

View File

@ -6,11 +6,8 @@ es5id: 15.5.4.20-2-44
description: >
String.prototype.trim - 'this' is a string that contains east
Asian characters (value is 'SD咕噜')
includes: [runTestCase.js]
---*/
function testcase() {
var str = "SD咕噜";
return str.trim() === str;
}
runTestCase(testcase);
assert.sameValue(str.trim(), str, 'str.trim()');

View File

@ -6,12 +6,9 @@ es5id: 15.5.4.20-2-45
description: >
String.prototype.trim - 'this' is a string that contains white
space, character, number, object and null characters
includes: [runTestCase.js]
---*/
function testcase() {
var str = "abc" + " " + 123 + " " + {} + " " + "\u0000";
var str1 = " " + str + " ";
return str1.trim() === str;
}
runTestCase(testcase);
assert.sameValue(str1.trim(), str, 'str1.trim()');

View File

@ -6,11 +6,8 @@ es5id: 15.5.4.20-2-46
description: >
String.prototype.trim - 'this' is a Function Object that converts
to a string
includes: [runTestCase.js]
---*/
function testcase() {
var funObj = function () { return arguments; };
return typeof(String.prototype.trim.call(funObj)) === "string";
}
runTestCase(testcase);
assert.sameValue(typeof(String.prototype.trim.call(funObj)), "string", 'typeof(String.prototype.trim.call(funObj))');

View File

@ -6,11 +6,8 @@ es5id: 15.5.4.20-2-49
description: >
String.prototype.trim - 'this' is a RegExp Object that converts to
a string
includes: [runTestCase.js]
---*/
function testcase() {
var regObj = new RegExp(/test/);
return String.prototype.trim.call(regObj) === "/test/";
}
runTestCase(testcase);
assert.sameValue(String.prototype.trim.call(regObj), "/test/", 'String.prototype.trim.call(regObj)');

View File

@ -6,11 +6,8 @@ es5id: 15.5.4.20-2-50
description: >
String.prototype.trim - 'this' is a Error Object that converts to
a string
includes: [runTestCase.js]
---*/
function testcase() {
var errObj = new Error("test");
return String.prototype.trim.call(errObj) === "Error: test";
}
runTestCase(testcase);
assert.sameValue(String.prototype.trim.call(errObj), "Error: test", 'String.prototype.trim.call(errObj)');

View File

@ -6,11 +6,8 @@ es5id: 15.5.4.20-2-51
description: >
String.prototype.trim - 'this' is a Arguments Object that converts
to a string
includes: [runTestCase.js]
---*/
function testcase() {
var argObj = function () { return arguments; } (1, 2, true);
return String.prototype.trim.call(argObj) === "[object Arguments]";
}
runTestCase(testcase);
assert.sameValue(String.prototype.trim.call(argObj), "[object Arguments]", 'String.prototype.trim.call(argObj)');

View File

@ -4,12 +4,8 @@
/*---
es5id: 15.5.4.20-3-1
description: String.prototype.trim - 'S' is a string with all LineTerminator
includes: [runTestCase.js]
---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
return (lineTerminatorsStr.trim() === "");
}
runTestCase(testcase);
assert.sameValue(lineTerminatorsStr.trim(), "", 'lineTerminatorsStr.trim()');

View File

@ -4,12 +4,8 @@
/*---
es5id: 15.5.4.20-3-2
description: String.prototype.trim - 'S' is a string with all WhiteSpace
includes: [runTestCase.js]
---*/
function testcase() {
var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
return (whiteSpacesStr.trim() === "");
}
runTestCase(testcase);
assert.sameValue(whiteSpacesStr.trim(), "", 'whiteSpacesStr.trim()');

View File

@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-3
description: >
String.prototype.trim - 'S' is a string with all union of
WhiteSpace and LineTerminator
includes: [runTestCase.js]
---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
var str = whiteSpacesStr + lineTerminatorsStr;
return (str.trim() === "");
}
runTestCase(testcase);
assert.sameValue(str.trim(), "", 'str.trim()');

View File

@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-4
description: >
String.prototype.trim - 'S' is a string start with union of all
LineTerminator and all WhiteSpace
includes: [runTestCase.js]
---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
var str = whiteSpacesStr + lineTerminatorsStr + "abc";
return (str.trim() === "abc");
}
runTestCase(testcase);
assert.sameValue(str.trim(), "abc", 'str.trim()');

View File

@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-5
description: >
String.prototype.trim - 'S' is a string end with union of all
LineTerminator and all WhiteSpace
includes: [runTestCase.js]
---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
var str = "abc" + whiteSpacesStr + lineTerminatorsStr ;
return (str.trim() === "abc");
}
runTestCase(testcase);
assert.sameValue(str.trim(), "abc", 'str.trim()');

View File

@ -7,14 +7,10 @@ description: >
String.prototype.trim - 'S' is a string start with union of all
LineTerminator and all WhiteSpace and end with union of all
LineTerminator and all WhiteSpace
includes: [runTestCase.js]
---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
var str = whiteSpacesStr + lineTerminatorsStr + "abc" + whiteSpacesStr + lineTerminatorsStr;
return (str.trim() === "abc");
}
runTestCase(testcase);
assert.sameValue(str.trim(), "abc", 'str.trim()');

View File

@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-7
description: >
String.prototype.trim - 'S' is a string that union of
LineTerminator and WhiteSpace in the middle
includes: [runTestCase.js]
---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029";
var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
var str = "ab" + whiteSpacesStr + lineTerminatorsStr + "cd";
return (str.trim() === str);
}
runTestCase(testcase);
assert.sameValue(str.trim(), str, 'str.trim()');

View File

@ -6,16 +6,11 @@ es5id: 15.5.4.20-4-1
description: >
String.prototype.trim handles multiline string with whitepace and
lineterminators
includes: [runTestCase.js]
---*/
function testcase() {
var s = "\u0009a b\
c \u0009"
if (s.trim() === "a bc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s.trim(), "a bc", 's.trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-11
description: >
String.prototype.trim handles whitepace and lineterminators
(abc\u0009)
includes: [runTestCase.js]
---*/
function testcase() {
if ("abc\u0009".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("abc\u0009".trim(), "abc", '"abc\u0009".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-12
description: >
String.prototype.trim handles whitepace and lineterminators
(abc\u000B)
includes: [runTestCase.js]
---*/
function testcase() {
if ("abc\u000B".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("abc\u000B".trim(), "abc", '"abc\u000B".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-13
description: >
String.prototype.trim handles whitepace and lineterminators
(abc\u000C)
includes: [runTestCase.js]
---*/
function testcase() {
if ("abc\u000C".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("abc\u000C".trim(), "abc", '"abc\u000C".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-14
description: >
String.prototype.trim handles whitepace and lineterminators
(abc\u0020)
includes: [runTestCase.js]
---*/
function testcase() {
if ("abc\u0020".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("abc\u0020".trim(), "abc", '"abc\u0020".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-16
description: >
String.prototype.trim handles whitepace and lineterminators
(abc\u00A0)
includes: [runTestCase.js]
---*/
function testcase() {
if ("abc\u00A0".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("abc\u00A0".trim(), "abc", '"abc\u00A0".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-19
description: >
String.prototype.trim handles whitepace and lineterminators
(\u0009abc\u0009)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u0009abc\u0009".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u0009abc\u0009".trim(), "abc", '"\u0009abc\u0009".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-2
description: >
String.prototype.trim handles whitepace and lineterminators (
\u0009abc \u0009)
includes: [runTestCase.js]
---*/
function testcase() {
if (" \u0009abc \u0009".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue(" \u0009abc \u0009".trim(), "abc", '" \u0009abc \u0009".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-20
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000Babc\u000B)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000Babc\u000B".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000Babc\u000B".trim(), "abc", '"\u000Babc\u000B".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-21
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000Cabc\u000C)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000Cabc\u000C".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000Cabc\u000C".trim(), "abc", '"\u000Cabc\u000C".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-22
description: >
String.prototype.trim handles whitepace and lineterminators
(\u0020abc\u0020)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u0020abc\u0020".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u0020abc\u0020".trim(), "abc", '"\u0020abc\u0020".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-24
description: >
String.prototype.trim handles whitepace and lineterminators
(\u00A0abc\u00A0)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u00A0abc\u00A0".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u00A0abc\u00A0".trim(), "abc", '"\u00A0abc\u00A0".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-27
description: >
String.prototype.trim handles whitepace and lineterminators
(\u0009\u0009)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u0009\u0009".trim() === "") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u0009\u0009".trim(), "", '"\u0009\u0009".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-28
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000B\u000B)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000B\u000B".trim() === "") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000B\u000B".trim(), "", '"\u000B\u000B".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-29
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000C\u000C)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000C\u000C".trim() === "") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000C\u000C".trim(), "", '"\u000C\u000C".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-3
description: >
String.prototype.trim handles whitepace and lineterminators
(\u0009abc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u0009abc".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u0009abc".trim(), "abc", '"\u0009abc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-30
description: >
String.prototype.trim handles whitepace and lineterminators
(\u0020\u0020)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u0020\u0020".trim() === "") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u0020\u0020".trim(), "", '"\u0020\u0020".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-32
description: >
String.prototype.trim handles whitepace and lineterminators
(\u00A0\u00A0)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u00A0\u00A0".trim() === "") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u00A0\u00A0".trim(), "", '"\u00A0\u00A0".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-35
description: >
String.prototype.trim handles whitepace and lineterminators
(ab\u0009c)
includes: [runTestCase.js]
---*/
function testcase() {
if ("ab\u0009c".trim() === "ab\u0009c") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("ab\u0009c".trim(), "ab\u0009c", '"ab\u0009c".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-36
description: >
String.prototype.trim handles whitepace and lineterminators
(ab\u000Bc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("ab\u000Bc".trim() === "ab\u000Bc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("ab\u000Bc".trim(), "ab\u000Bc", '"ab\u000Bc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-37
description: >
String.prototype.trim handles whitepace and lineterminators
(ab\u000Cc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("ab\u000Cc".trim() === "ab\u000Cc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("ab\u000Cc".trim(), "ab\u000Cc", '"ab\u000Cc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-38
description: >
String.prototype.trim handles whitepace and lineterminators
(ab\u0020c)
includes: [runTestCase.js]
---*/
function testcase() {
if ("ab\u0020c".trim() === "ab\u0020c") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("ab\u0020c".trim(), "ab\u0020c", '"ab\u0020c".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-4
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000Babc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000Babc".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000Babc".trim(), "abc", '"\u000Babc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-40
description: >
String.prototype.trim handles whitepace and lineterminators
(ab\u00A0c)
includes: [runTestCase.js]
---*/
function testcase() {
if ("ab\u00A0c".trim() === "ab\u00A0c") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("ab\u00A0c".trim(), "ab\u00A0c", '"ab\u00A0c".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-41
description: >
String.prototype.trim handles whitepace and lineterminators
(ab\u200Bc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("ab\u200Bc".trim() === "ab\u200Bc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("ab\u200Bc".trim(), "ab\u200Bc", '"ab\u200Bc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-42
description: >
String.prototype.trim handles whitepace and lineterminators
(ab\uFEFFc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("ab\uFEFFc".trim() === "ab\uFEFFc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("ab\uFEFFc".trim(), "ab\uFEFFc", '"ab\uFEFFc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-43
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000Aabc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000Aabc".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000Aabc".trim(), "abc", '"\u000Aabc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-44
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000Dabc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000Dabc".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000Dabc".trim(), "abc", '"\u000Dabc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-45
description: >
String.prototype.trim handles whitepace and lineterminators
(\u2028abc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u2028abc".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u2028abc".trim(), "abc", '"\u2028abc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-46
description: >
String.prototype.trim handles whitepace and lineterminators
(\u2029abc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u2029abc".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u2029abc".trim(), "abc", '"\u2029abc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-47
description: >
String.prototype.trim handles whitepace and lineterminators
(abc\u000A)
includes: [runTestCase.js]
---*/
function testcase() {
if ("abc\u000A".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("abc\u000A".trim(), "abc", '"abc\u000A".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-48
description: >
String.prototype.trim handles whitepace and lineterminators
(abc\u000D)
includes: [runTestCase.js]
---*/
function testcase() {
if ("abc\u000D".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("abc\u000D".trim(), "abc", '"abc\u000D".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-49
description: >
String.prototype.trim handles whitepace and lineterminators
(abc\u2028)
includes: [runTestCase.js]
---*/
function testcase() {
if ("abc\u2028".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("abc\u2028".trim(), "abc", '"abc\u2028".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-5
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000Cabc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000Cabc".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000Cabc".trim(), "abc", '"\u000Cabc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-50
description: >
String.prototype.trim handles whitepace and lineterminators
(abc\u2029)
includes: [runTestCase.js]
---*/
function testcase() {
if ("abc\u2029".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("abc\u2029".trim(), "abc", '"abc\u2029".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-51
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000Aabc\u000A)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000Aabc\u000A".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000Aabc\u000A".trim(), "abc", '"\u000Aabc\u000A".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-52
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000Dabc\u000D)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000Dabc\u000D".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000Dabc\u000D".trim(), "abc", '"\u000Dabc\u000D".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-53
description: >
String.prototype.trim handles whitepace and lineterminators
(\u2028abc\u2028)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u2028abc\u2028".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u2028abc\u2028".trim(), "abc", '"\u2028abc\u2028".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-54
description: >
String.prototype.trim handles whitepace and lineterminators
(\u2029abc\u2029)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u2029abc\u2029".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u2029abc\u2029".trim(), "abc", '"\u2029abc\u2029".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-55
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000A\u000A)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000A\u000A".trim() === "") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000A\u000A".trim(), "", '"\u000A\u000A".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-56
description: >
String.prototype.trim handles whitepace and lineterminators
(\u000D\u000D)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u000D\u000D".trim() === "") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u000D\u000D".trim(), "", '"\u000D\u000D".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-57
description: >
String.prototype.trim handles whitepace and lineterminators
(\u2028\u2028)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u2028\u2028".trim() === "") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u2028\u2028".trim(), "", '"\u2028\u2028".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-58
description: >
String.prototype.trim handles whitepace and lineterminators
(\u2029\u2029)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u2029\u2029".trim() === "") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u2029\u2029".trim(), "", '"\u2029\u2029".trim()');

View File

@ -6,14 +6,9 @@ es5id: 15.5.4.20-4-59
description: >
String.prototype.trim handles whitepace and lineterminators
(\u2029abc as a multiline string)
includes: [runTestCase.js]
---*/
function testcase() {
var s = "\u2029\
abc";
if (s.trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue(s.trim(), "abc", 's.trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-6
description: >
String.prototype.trim handles whitepace and lineterminators
(\u0020abc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u0020abc".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u0020abc".trim(), "abc", '"\u0020abc".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-60
description: >
String.prototype.trim handles whitepace and lineterminators
(string with just blanks)
includes: [runTestCase.js]
---*/
function testcase() {
if (" ".trim() === "") {
return true;
}
}
runTestCase(testcase);
assert.sameValue(" ".trim(), "", '" ".trim()');

View File

@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-8
description: >
String.prototype.trim handles whitepace and lineterminators
(\u00A0abc)
includes: [runTestCase.js]
---*/
function testcase() {
if ("\u00A0abc".trim() === "abc") {
return true;
}
}
runTestCase(testcase);
assert.sameValue("\u00A0abc".trim(), "abc", '"\u00A0abc".trim()');