Debian Codegraph @

rhino/testsrc/tests/ecma_2/RegExp/regress-001.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 gTestfile = 'regress-001.js';
7
8 /**
9 * File Name: RegExp/regress-001.js
10 * ECMA Section: N/A
11 * Description: Regression test case:
12 * JS regexp anchoring on empty match bug
13 * http://bugzilla.mozilla.org/show_bug.cgi?id=2157
14 *
15 * Author: [email protected]
16 * Date: 19 February 1999
17 */
18 var SECTION = "RegExp/hex-001.js";
19 var VERSION = "ECMA_2";
20 var TITLE = "JS regexp anchoring on empty match bug";
21 var BUGNUMBER = "2157";
22
23 startTest();
24
25 AddRegExpCases( /a||b/(''),
26 "//a||b/('')",
27 1,
28 [''] );
29
30 test();
31
32 function AddRegExpCases( regexp, str_regexp, length, matches_array ) {
33
34 AddTestCase(
35 "( " + str_regexp + " ).length",
36 regexp.length,
37 regexp.length );
38
39
40 for ( var matches = 0; matches < matches_array.length; matches++ ) {
41 AddTestCase(
42 "( " + str_regexp + " )[" + matches +"]",
43 matches_array[matches],
44 regexp[matches] );
45 }
46 }