Debian Codegraph @

rhino/testsrc/tests/ecma_3/RegExp/regress-31316.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 * Date: 01 May 2001
8 *
9 * SUMMARY: Regression test for Bugzilla bug 31316:
10 * "Rhino: Regexp matches return garbage"
11 *
12 * See http://bugzilla.mozilla.org/show_bug.cgi?id=31316
13 */
14 //-----------------------------------------------------------------------------
15 var gTestfile = 'regress-31316.js';
16 var i = 0;
17 var BUGNUMBER = 31316;
18 var summary = 'Regression test for Bugzilla bug 31316';
19 var cnEmptyString = '';
20 var status = '';
21 var statusmessages = new Array();
22 var pattern = '';
23 var patterns = new Array();
24 var string = '';
25 var strings = new Array();
26 var actualmatch = '';
27 var actualmatches = new Array();
28 var expectedmatch = '';
29 var expectedmatches = new Array();
30
31
32 status = inSection(1);
33 pattern = /<([^\/<>][^<>]*[^\/])>|<([^\/<>])>/;
34 string = '<p>Some<br />test</p>';
35 actualmatch = string.match(pattern);
36 expectedmatch = Array('<p>', undefined, 'p');
37 addThis();
38
39
40 //-------------------------------------------------------------------------------------------------
41 test();
42 //-------------------------------------------------------------------------------------------------
43
44
45 function addThis()
46 {
47 statusmessages[i] = status;
48 patterns[i] = pattern;
49 strings[i] = string;
50 actualmatches[i] = actualmatch;
51 expectedmatches[i] = expectedmatch;
52 i++;
53 }
54
55
56 function test()
57 {
58 enterFunc ('test');
59 printBugNumber(BUGNUMBER);
60 printStatus (summary);
61 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
62 exitFunc ('test');
63 }