Debian Codegraph @

js/src/tests/test262/built-ins/RegExp/S15.10.2.8_A3_T17.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 Parentheses of the form ( Disjunction ) serve both to group the components of the Disjunction pattern together and to save the result of the match.
7 The result can be used either in a backreference (\ followed by a nonzero decimal number),
8 referenced in a replace string,
9 or returned as part of an array from the regular expression matching function
10 es5id: 15.10.2.8_A3_T17
11 description: "see bug http:bugzilla.mozilla.org/show_bug.cgi?id=169497"
12 ---*/
13
14 var __body="";
15 __body += '<body onXXX="alert(event.type);">\n';
16 __body += '<p>Kibology for all<\/p>\n';
17 __body += '<p>All for Kibology<\/p>\n';
18 __body += '<\/body>';
19
20 var __html="";
21 __html += '<html>\n';
22 __html += __body;
23 __html += '\n<\/html>';
24
25 var __executed = /<body.*>((.*\n?)*?)<\/body>/i.exec(__html);
26
27 var __expected = [__body, '\n<p>Kibology for all</p>\n<p>All for Kibology</p>\n', '<p>All for Kibology</p>\n'];
28 __expected.index = 7;
29 __expected.input = __html;
30
31 assert.sameValue(
32 __executed.length,
33 __expected.length,
34 'The value of __executed.length is expected to equal the value of __expected.length'
35 );
36
37 assert.sameValue(
38 __executed.index,
39 __expected.index,
40 'The value of __executed.index is expected to equal the value of __expected.index'
41 );
42
43 assert.sameValue(
44 __executed.input,
45 __expected.input,
46 'The value of __executed.input is expected to equal the value of __expected.input'
47 );
48
49 for(var index=0; index<__expected.length; index++) {
50 assert.sameValue(
51 __executed[index],
52 __expected[index],
53 'The value of __executed[index] is expected to equal the value of __expected[index]'
54 );
55 }
56
57 reportCompare(0, 0);