| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'beginLine.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: beginLine.js'); |
| 22 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
new TestCase ( SECTION, "'abcde'.match(new RegExp('^ab'))", |
| 27 |
String(["ab"]), String('abcde'.match(new RegExp('^ab')))); |
| 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, "'^^^x'.match(new RegExp('^\\^+'))", |
| 39 |
String(['^^^']), String('^^^x'.match(new RegExp('^\\^+')))); |
| 40 |
|
| 41 |
|
| 42 |
new TestCase ( SECTION, "'^^^x'.match(/^\\^+/)", |
| 43 |
String(['^^^']), String('^^^x'.match(/^\^+/))); |
| 44 |
|
| 45 |
RegExp.multiline = true; |
| 46 |
|
| 47 |
new TestCase ( SECTION, "'abc\n123xyz'.match(new RegExp('^\\d+'))", |
| 48 |
String(['123']), String('abc\n123xyz'.match(new RegExp('^\\d+')))); |
| 49 |
|
| 50 |
test(); |