js/src/tests/js1_2/regexp/RegExp_lastIndex.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:7a16d14c8dfe
1 // |reftest| skip -- obsolete test
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
8 /**
9 Filename: RegExp_lastIndex.js
10 Description: 'Tests RegExps lastIndex property'
11
12 Author: Nick Lerissa
13 Date: March 17, 1998
14 */
15
16 var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
17 var VERSION = 'no version';
18 var TITLE = 'RegExp: lastIndex';
19 var BUGNUMBER="123802";
20
21 startTest();
22 writeHeaderToLog('Executing script: RegExp_lastIndex.js');
23 writeHeaderToLog( SECTION + " "+ TITLE);
24
25 // re=/x./g; re.lastIndex=4; re.exec('xyabcdxa');
26 re=/x./g;
27 re.lastIndex=4;
28 new TestCase ( SECTION, "re=/x./g; re.lastIndex=4; re.exec('xyabcdxa')",
29 '["xa"]', String(re.exec('xyabcdxa')));
30
31 // re.lastIndex
32 new TestCase ( SECTION, "re.lastIndex",
33 8, re.lastIndex);
34
35 // re.exec('xyabcdef');
36 new TestCase ( SECTION, "re.exec('xyabcdef')",
37 null, re.exec('xyabcdef'));
38
39 // re.lastIndex
40 new TestCase ( SECTION, "re.lastIndex",
41 0, re.lastIndex);
42
43 // re.exec('xyabcdef');
44 new TestCase ( SECTION, "re.exec('xyabcdef')",
45 '["xy"]', String(re.exec('xyabcdef')));
46
47 // re.lastIndex=30; re.exec('123xaxbxc456');
48 re.lastIndex=30;
49 new TestCase ( SECTION, "re.lastIndex=30; re.exec('123xaxbxc456')",
50 null, re.exec('123xaxbxc456'));
51
52 test();

mercurial