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: > description: >
String object supports bracket notation to lookup of data String object supports bracket notation to lookup of data
properties properties
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var s = new String("hello world"); var s = new String("hello world");
s.foo = 1; s.foo = 1;
if (s["foo"] === 1) {
return true; assert.sameValue(s["foo"], 1, 's["foo"]');
}
}
runTestCase(testcase);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,10 +6,8 @@ es5id: 15.5.4.20-2-41
description: > description: >
String.prototype.trim - 'this' is an object which has an own String.prototype.trim - 'this' is an object which has an own
toString and valueOf method. toString and valueOf method.
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var toStringAccessed = false; var toStringAccessed = false;
var valueOfAccessed = false; var valueOfAccessed = false;
var obj = { var obj = {
@ -22,6 +20,7 @@ function testcase() {
return "cef"; return "cef";
} }
}; };
return (String.prototype.trim.call(obj) === "abc") && !valueOfAccessed && toStringAccessed;
} assert.sameValue(String.prototype.trim.call(obj), "abc", 'String.prototype.trim.call(obj)');
runTestCase(testcase); 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 String.prototype.trim - 'this' is an object with an own valueOf
and inherited toString methods with hint string, verify inherited and inherited toString methods with hint string, verify inherited
toString method will be called first toString method will be called first
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var toStringAccessed = false; var toStringAccessed = false;
var valueOfAccessed = false; var valueOfAccessed = false;
@ -30,6 +27,7 @@ function testcase() {
valueOfAccessed = true; valueOfAccessed = true;
return "efg"; return "efg";
}; };
return (String.prototype.trim.call(child) === "abc") && toStringAccessed && !valueOfAccessed;
} assert.sameValue(String.prototype.trim.call(child), "abc", 'String.prototype.trim.call(child)');
runTestCase(testcase); assert(toStringAccessed, 'toStringAccessed !== true');
assert.sameValue(valueOfAccessed, false, 'valueOfAccessed');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,12 +4,8 @@
/*--- /*---
es5id: 15.5.4.20-3-2 es5id: 15.5.4.20-3-2
description: String.prototype.trim - 'S' is a string with all WhiteSpace 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"; 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() === "");
} assert.sameValue(whiteSpacesStr.trim(), "", 'whiteSpacesStr.trim()');
runTestCase(testcase);

View File

@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-3
description: > description: >
String.prototype.trim - 'S' is a string with all union of String.prototype.trim - 'S' is a string with all union of
WhiteSpace and LineTerminator WhiteSpace and LineTerminator
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; 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 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; var str = whiteSpacesStr + lineTerminatorsStr;
return (str.trim() === ""); assert.sameValue(str.trim(), "", 'str.trim()');
}
runTestCase(testcase);

View File

@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-4
description: > description: >
String.prototype.trim - 'S' is a string start with union of all String.prototype.trim - 'S' is a string start with union of all
LineTerminator and all WhiteSpace LineTerminator and all WhiteSpace
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; 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 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"; var str = whiteSpacesStr + lineTerminatorsStr + "abc";
return (str.trim() === "abc"); assert.sameValue(str.trim(), "abc", 'str.trim()');
}
runTestCase(testcase);

View File

@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-5
description: > description: >
String.prototype.trim - 'S' is a string end with union of all String.prototype.trim - 'S' is a string end with union of all
LineTerminator and all WhiteSpace LineTerminator and all WhiteSpace
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; 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 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 ; var str = "abc" + whiteSpacesStr + lineTerminatorsStr ;
return (str.trim() === "abc"); assert.sameValue(str.trim(), "abc", 'str.trim()');
}
runTestCase(testcase);

View File

@ -7,14 +7,10 @@ description: >
String.prototype.trim - 'S' is a string start with union of all 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 and end with union of all
LineTerminator and all WhiteSpace LineTerminator and all WhiteSpace
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; 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 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; var str = whiteSpacesStr + lineTerminatorsStr + "abc" + whiteSpacesStr + lineTerminatorsStr;
return (str.trim() === "abc"); assert.sameValue(str.trim(), "abc", 'str.trim()');
}
runTestCase(testcase);

View File

@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-7
description: > description: >
String.prototype.trim - 'S' is a string that union of String.prototype.trim - 'S' is a string that union of
LineTerminator and WhiteSpace in the middle LineTerminator and WhiteSpace in the middle
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; 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 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"; var str = "ab" + whiteSpacesStr + lineTerminatorsStr + "cd";
return (str.trim() === str); assert.sameValue(str.trim(), str, 'str.trim()');
}
runTestCase(testcase);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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