Debian Codegraph @

rhino/testsrc/tests/ecma_3/RegExp/regress-169497.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: 31 August 2002
9 * SUMMARY: RegExp conformance test
10 * See http://bugzilla.mozilla.org/show_bug.cgi?id=169497
11 *
12 */
13 //-----------------------------------------------------------------------------
14 var gTestfile = 'regress-169497.js';
15 var i = 0;
16 var BUGNUMBER = 169497;
17 var summary = 'RegExp conformance test';
18 var status = '';
19 var statusmessages = new Array();
20 var pattern = '';
21 var patterns = new Array();
22 var sBody = '';
23 var sHTML = '';
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 sBody += '<body onXXX="alert(event.type);">\n';
32 sBody += '<p>Kibology for all<\/p>\n';
33 sBody += '<p>All for Kibology<\/p>\n';
34 sBody += '<\/body>';
35
36 sHTML += '<html>\n';
37 sHTML += sBody;
38 sHTML += '\n<\/html>';
39
40 status = inSection(1);
41 string = sHTML;
42 pattern = /<body.*>((.*\n?)*?)<\/body>/i;
43 actualmatch = string.match(pattern);
44 expectedmatch = Array(sBody, '\n<p>Kibology for all</p>\n<p>All for Kibology</p>\n', '<p>All for Kibology</p>\n');
45 addThis();
46
47
48
49 //-------------------------------------------------------------------------------------------------
50 test();
51 //-------------------------------------------------------------------------------------------------
52
53
54 function addThis()
55 {
56 statusmessages[i] = status;
57 patterns[i] = pattern;
58 strings[i] = string;
59 actualmatches[i] = actualmatch;
60 expectedmatches[i] = expectedmatch;
61 i++;
62 }
63
64
65 function test()
66 {
67 enterFunc ('test');
68 printBugNumber(BUGNUMBER);
69 printStatus (summary);
70 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
71 exitFunc ('test');
72 }