Debian Codegraph @

rhino/testsrc/tests/ecma_3/extensions/regress-220367-002.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-002.js';
16 var UBound = 0;
17 var BUGNUMBER = 220367;
18 var summary = 'Regexp conformance test';
19 var status = '';
20 var statusitems = [];
21 var actual = '';
22 var actualvalues = [];
23 var expect= '';
24 var expectedvalues = [];
25
26 var re = /(a)|(b)/;
27
28 re.test('a');
29 status = inSection(1);
30 actual = RegExp.$1;
31 expect = 'a';
32 addThis();
33
34 status = inSection(2);
35 actual = RegExp.$2;
36 expect = '';
37 addThis();
38
39 re.test('b');
40 status = inSection(3);
41 actual = RegExp.$1;
42 expect = '';
43 addThis();
44
45 status = inSection(4);
46 actual = RegExp.$2;
47 expect = 'b';
48 addThis();
49
50
51
52 //-----------------------------------------------------------------------------
53 test();
54 //-----------------------------------------------------------------------------
55
56
57
58 function addThis()
59 {
60 statusitems[UBound] = status;
61 actualvalues[UBound] = actual;
62 expectedvalues[UBound] = expect;
63 UBound++;
64 }
65
66
67 function test()
68 {
69 enterFunc('test');
70 printBugNumber(BUGNUMBER);
71 printStatus(summary);
72
73 for (var i=0; i<UBound; i++)
74 {
75 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
76 }
77
78 exitFunc ('test');
79 }