| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'dot.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: dot.js'); |
| 22 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
new TestCase ( SECTION, "'abcde'.match(new RegExp('ab.de'))", |
| 27 |
String(["abcde"]), String('abcde'.match(new RegExp('ab.de')))); |
| 28 |
|
| 29 |
|
| 30 |
new TestCase ( SECTION, "'line 1\nline 2'.match(new RegExp('.+'))", |
| 31 |
String(["line 1"]), String('line 1\nline 2'.match(new RegExp('.+')))); |
| 32 |
|
| 33 |
|
| 34 |
new TestCase ( SECTION, "'this is a test'.match(new RegExp('.*a.*'))", |
| 35 |
String(["this is a test"]), String('this is a test'.match(new RegExp('.*a.*')))); |
| 36 |
|
| 37 |
|
| 38 |
new TestCase ( SECTION, "'this is a *&^%$# test'.match(new RegExp('.+'))", |
| 39 |
String(["this is a *&^%$# test"]), String('this is a *&^%$# test'.match(new RegExp('.+')))); |
| 40 |
|
| 41 |
|
| 42 |
new TestCase ( SECTION, "'....'.match(new RegExp('.+'))", |
| 43 |
String(["...."]), String('....'.match(new RegExp('.+')))); |
| 44 |
|
| 45 |
|
| 46 |
new TestCase ( SECTION, "'abcdefghijklmnopqrstuvwxyz'.match(new RegExp('.+'))", |
| 47 |
String(["abcdefghijklmnopqrstuvwxyz"]), String('abcdefghijklmnopqrstuvwxyz'.match(new RegExp('.+')))); |
| 48 |
|
| 49 |
|
| 50 |
new TestCase ( SECTION, "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.match(new RegExp('.+'))", |
| 51 |
String(["ABCDEFGHIJKLMNOPQRSTUVWXYZ"]), String('ABCDEFGHIJKLMNOPQRSTUVWXYZ'.match(new RegExp('.+')))); |
| 52 |
|
| 53 |
|
| 54 |
new TestCase ( SECTION, "'`1234567890-=~!@#$%^&*()_+'.match(new RegExp('.+'))", |
| 55 |
String(["`1234567890-=~!@#$%^&*()_+"]), String('`1234567890-=~!@#$%^&*()_+'.match(new RegExp('.+')))); |
| 56 |
|
| 57 |
|
| 58 |
new TestCase ( SECTION, "'|\\[{]};:\"\',<>.?/'.match(new RegExp('.+'))", |
| 59 |
String(["|\\[{]};:\"\',<>.?/"]), String('|\\[{]};:\"\',<>.?/'.match(new RegExp('.+')))); |
| 60 |
|
| 61 |
|
| 62 |
new TestCase ( SECTION, "'|\\[{]};:\"\',<>.?/'.match(/.+/)", |
| 63 |
String(["|\\[{]};:\"\',<>.?/"]), String('|\\[{]};:\"\',<>.?/'.match(/.+/))); |
| 64 |
|
| 65 |
test(); |