| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'endLine.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; |
| 17 |
var VERSION = 'no version'; |
| 18 |
startTest(); |
| 19 |
var TITLE = 'RegExp: $'; |
| 20 |
|
| 21 |
writeHeaderToLog('Executing script: endLine.js'); |
| 22 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
new TestCase ( SECTION, "'abcde'.match(new RegExp('de$'))", |
| 27 |
String(["de"]), String('abcde'.match(new RegExp('de$')))); |
| 28 |
|
| 29 |
|
| 30 |
new TestCase ( SECTION, "'ab\ncde'.match(new RegExp('..$e$'))", |
| 31 |
null, 'ab\ncde'.match(new RegExp('..$e$'))); |
| 32 |
|
| 33 |
|
| 34 |
new TestCase ( SECTION, "'yyyyy'.match(new RegExp('xxx$'))", |
| 35 |
null, 'yyyyy'.match(new RegExp('xxx$'))); |
| 36 |
|
| 37 |
|
| 38 |
new TestCase ( SECTION, "'a$$$'.match(new RegExp('\\$+$'))", |
| 39 |
String(['$$$']), String('a$$$'.match(new RegExp('\\$+$')))); |
| 40 |
|
| 41 |
|
| 42 |
new TestCase ( SECTION, "'a$$$'.match(/\\$+$/)", |
| 43 |
String(['$$$']), String('a$$$'.match(/\$+$/))); |
| 44 |
|
| 45 |
RegExp.multiline = true; |
| 46 |
|
| 47 |
new TestCase ( SECTION, "'abc\n123xyz890\nxyz'.match(new RegExp('\\d+$'))", |
| 48 |
String(['890']), String('abc\n123xyz890\nxyz'.match(new RegExp('\\d+$')))); |
| 49 |
|
| 50 |
test(); |