* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / Microsoft.JScript / Test / Mozilla / ecma_2 / RegExp / regress-001.js
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /**
3  *  File Name:          RegExp/regress-001.js
4  *  ECMA Section:       N/A
5  *  Description:        Regression test case:
6  *  JS regexp anchoring on empty match bug
7  *  http://bugzilla.mozilla.org/show_bug.cgi?id=2157
8  *
9  *  Author:             christine@netscape.com
10  *  Date:               19 February 1999
11  */
12 var SECTION = "RegExp/hex-001.js";
13 var VERSION = "ECMA_2";
14 var TITLE   = "JS regexp anchoring on empty match bug";
15 var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=2157";
16
17 startTest();
18
19 AddRegExpCases( /a||b/(''),
20                 "//a||b/('')",
21                 1,
22                 [''] );
23
24 test();
25
26 function AddRegExpCases( regexp, str_regexp, length, matches_array ) {
27
28   AddTestCase(
29     "( " + str_regexp + " ).length",
30     regexp.length,
31     regexp.length );
32
33
34   for ( var matches = 0; matches < matches_array.length; matches++ ) {
35     AddTestCase(
36       "( " + str_regexp + " )[" + matches +"]",
37       matches_array[matches],
38       regexp[matches] );
39   }
40 }