Debian Codegraph @

rhino/testsrc/tests/ecma_3/RegExp/regress-220367-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 /*
7 *
8 * Date: 26 September 2003
9 * SUMMARY: Regexp conformance test
10 *
11 * See http://bugzilla.mozilla.org/show_bug.cgi?id=220367
12 *
13 */
14 //-----------------------------------------------------------------------------
15 var gTestfile = 'regress-220367-001.js';
16 var i = 0;
17 var BUGNUMBER = 220367;
18 var summary = 'Regexp conformance test';
19 var status = '';
20 var statusmessages = new Array();
21 var pattern = '';
22 var patterns = new Array();
23 var string = '';
24 var strings = new Array();
25 var actualmatch = '';
26 var actualmatches = new Array();
27 var expectedmatch = '';
28 var expectedmatches = new Array();
29
30
31 status = inSection(1);
32 string = 'a';
33 pattern = /(a)|(b)/;
34 actualmatch = string.match(pattern);
35 expectedmatch = Array(string, 'a', undefined);
36 addThis();
37
38 status = inSection(2);
39 string = 'b';
40 pattern = /(a)|(b)/;
41 actualmatch = string.match(pattern);
42 expectedmatch = Array(string, undefined, 'b');
43 addThis();
44
45
46
47 //-----------------------------------------------------------------------------
48 test();
49 //-----------------------------------------------------------------------------
50
51
52
53 function addThis()
54 {
55 statusmessages[i] = status;
56 patterns[i] = pattern;
57 strings[i] = string;
58 actualmatches[i] = actualmatch;
59 expectedmatches[i] = expectedmatch;
60 i++;
61 }
62
63
64 function test()
65 {
66 enterFunc ('test');
67 printBugNumber(BUGNUMBER);
68 printStatus (summary);
69 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
70 exitFunc ('test');
71 }