| This test checks the ES6 string functions startsWith(), endsWith() and contains(). |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| PASS 'foo bar'.contains('bar') is true |
| PASS 'foo bar'.contains('bar', 4) is true |
| PASS 'foo bar'.contains('ar', 5) is true |
| PASS 'foo bar'.contains('qux') is false |
| PASS 'foo bar'.contains('foo') is true |
| PASS 'foo bar'.contains('foo', 0) is true |
| PASS 'foo bar'.contains('foo', -1) is true |
| PASS 'foo bar'.contains('') is true |
| PASS 'foo bar'.contains() is false |
| PASS 'foo bar qux'.contains('qux', 7) is true |
| PASS 'foo bar qux'.contains('bar', 7) is false |
| PASS 'foo null bar'.contains() is false |
| PASS 'foo null bar'.contains(null) is true |
| PASS 'foo null bar'.contains(null) is true |
| PASS 'foo undefined bar'.contains() is true |
| PASS 'foo undefined bar'.contains(undefined) is true |
| PASS 'foo undefined bar'.contains() is true |
| PASS 'foo undefined bar'.contains() is true |
| PASS 'foo true bar'.contains(true) is true |
| PASS 'foo false bar'.contains(false) is true |
| PASS 'foo 1 bar'.contains(1) is true |
| PASS 'foo 1.1 bar'.contains(1.1) is true |
| PASS 'foo NaN bar'.contains(NaN) is true |
| PASS 'foo 1.0 bar'.contains(1.0) is true |
| PASS 'foo 1e+100 bar'.contains(1e+100) is true |
| PASS 'foo 1e100 bar'.contains(1e100) is false |
| PASS 'フーバー'.contains('ーバ') is true |
| PASS 'フーバー'.contains('クー') is false |
| PASS 'foo bar'.startsWith('foo') is true |
| PASS 'foo bar'.startsWith('foo', 0) is true |
| PASS 'foo bar'.startsWith('foo', -1) is true |
| PASS 'foo bar'.startsWith('oo', 1) is true |
| PASS 'foo bar'.startsWith('qux') is false |
| PASS 'foo bar'.startsWith('') is true |
| PASS 'foo bar'.startsWith() is false |
| PASS 'null'.startsWith() is false |
| PASS 'null'.startsWith(null) is true |
| PASS 'null bar'.startsWith(null) is true |
| PASS 'undefined'.startsWith() is true |
| PASS 'undefined'.startsWith(undefined) is true |
| PASS 'undefined bar'.startsWith() is true |
| PASS 'undefined bar'.startsWith() is true |
| PASS 'true bar'.startsWith(true) is true |
| PASS 'false bar'.startsWith(false) is true |
| PASS '1 bar'.startsWith(1) is true |
| PASS '1.1 bar'.startsWith(1.1) is true |
| PASS 'NaN bar'.startsWith(NaN) is true |
| PASS '1e+100 bar'.startsWith(1e+100) is true |
| PASS '1e100 bar'.startsWith(1e100) is false |
| PASS 'フーバー'.startsWith('フー') is true |
| PASS 'フーバー'.startsWith('バー') is false |
| PASS 'foo bar'.endsWith('bar') is true |
| PASS 'foo bar'.endsWith('ba', 6) is true |
| PASS 'foo bar'.endsWith(' ba', 6) is true |
| PASS 'foo bar'.endsWith('foo bar') is true |
| PASS 'foo bar'.endsWith('foo bar', 7) is true |
| PASS 'foo bar'.endsWith('foo bar', 8) is true |
| PASS 'foo bar'.endsWith('foo bar', -1) is false |
| PASS 'foo bar'.endsWith('qux') is false |
| PASS 'foo bar'.endsWith('') is true |
| PASS 'foo bar'.endsWith() is false |
| PASS 'foo null'.endsWith() is false |
| PASS 'foo null'.endsWith(null) is true |
| PASS 'foo null'.endsWith(null) is true |
| PASS 'foo undefined'.endsWith() is true |
| PASS 'foo undefined'.endsWith(undefined) is true |
| PASS 'foo undefined'.endsWith() is true |
| PASS 'foo undefined'.endsWith() is true |
| PASS 'foo true'.endsWith(true) is true |
| PASS 'foo false'.endsWith(false) is true |
| PASS 'foo 1'.endsWith(1) is true |
| PASS 'foo 1.1'.endsWith(1.1) is true |
| PASS 'foo NaN'.endsWith(NaN) is true |
| PASS 'foo 1e+100'.endsWith(1e+100) is true |
| PASS 'foo 1e100'.endsWith(1e100) is false |
| PASS 'フーバー'.endsWith('バー') is true |
| PASS 'フーバー'.endsWith('フー') is false |
| PASS (function() { var f = String.prototype.startsWith; (function() { f('a'); })(); })() threw exception TypeError: Type error. |
| PASS (function() { var f = String.prototype.endsWith; (function() { f('a'); })(); })() threw exception TypeError: Type error. |
| PASS (function() { var f = String.prototype.contains; (function() { f('a'); })(); })() threw exception TypeError: Type error. |
| PASS 'foo bar'.startsWith(/w+/) threw exception TypeError: Type error. |
| PASS 'foo bar'.endsWith(/w+/) threw exception TypeError: Type error. |
| PASS 'foo bar'.contains(/w+/) threw exception TypeError: Type error. |
| PASS stringToSearchIn.startsWith(matchString, startOffset) is true |
| PASS sideEffect == 'ABC' is true |
| PASS stringToSearchIn.startsWith(matchString, startOffset) threw exception error. |
| PASS sideEffect == '' is true |
| PASS stringToSearchIn.startsWith(matchString, startOffset) threw exception error. |
| PASS sideEffect == 'A' is true |
| PASS stringToSearchIn.startsWith(matchString, startOffset) threw exception error. |
| PASS sideEffect == 'AB' is true |
| PASS stringToSearchIn.endsWith(matchString, endOffset) is true |
| PASS sideEffect == 'ABC' is true |
| PASS stringToSearchIn.endsWith(matchString, endOffset) threw exception error. |
| PASS sideEffect == '' is true |
| PASS stringToSearchIn.endsWith(matchString, endOffset) threw exception error. |
| PASS sideEffect == 'A' is true |
| PASS stringToSearchIn.endsWith(matchString, endOffset) threw exception error. |
| PASS sideEffect == 'AB' is true |
| PASS stringToSearchIn.contains(matchString, startOffset) is true |
| PASS sideEffect == 'ABC' is true |
| PASS stringToSearchIn.contains(matchString, startOffset) threw exception error. |
| PASS sideEffect == '' is true |
| PASS stringToSearchIn.contains(matchString, startOffset) threw exception error. |
| PASS sideEffect == 'A' is true |
| PASS stringToSearchIn.contains(matchString, startOffset) threw exception error. |
| PASS sideEffect == 'AB' is true |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |