1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma_3/RegExp/regress-169497.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,71 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* 1.10 + * 1.11 + * Date: 31 August 2002 1.12 + * SUMMARY: RegExp conformance test 1.13 + * See http://bugzilla.mozilla.org/show_bug.cgi?id=169497 1.14 + * 1.15 + */ 1.16 +//----------------------------------------------------------------------------- 1.17 +var i = 0; 1.18 +var BUGNUMBER = 169497; 1.19 +var summary = 'RegExp conformance test'; 1.20 +var status = ''; 1.21 +var statusmessages = new Array(); 1.22 +var pattern = ''; 1.23 +var patterns = new Array(); 1.24 +var sBody = ''; 1.25 +var sHTML = ''; 1.26 +var string = ''; 1.27 +var strings = new Array(); 1.28 +var actualmatch = ''; 1.29 +var actualmatches = new Array(); 1.30 +var expectedmatch = ''; 1.31 +var expectedmatches = new Array(); 1.32 + 1.33 +sBody += '<body onXXX="alert(event.type);">\n'; 1.34 +sBody += '<p>Kibology for all<\/p>\n'; 1.35 +sBody += '<p>All for Kibology<\/p>\n'; 1.36 +sBody += '<\/body>'; 1.37 + 1.38 +sHTML += '<html>\n'; 1.39 +sHTML += sBody; 1.40 +sHTML += '\n<\/html>'; 1.41 + 1.42 +status = inSection(1); 1.43 +string = sHTML; 1.44 +pattern = /<body.*>((.*\n?)*?)<\/body>/i; 1.45 +actualmatch = string.match(pattern); 1.46 +expectedmatch = Array(sBody, '\n<p>Kibology for all</p>\n<p>All for Kibology</p>\n', '<p>All for Kibology</p>\n'); 1.47 +addThis(); 1.48 + 1.49 + 1.50 + 1.51 +//------------------------------------------------------------------------------------------------- 1.52 +test(); 1.53 +//------------------------------------------------------------------------------------------------- 1.54 + 1.55 + 1.56 +function addThis() 1.57 +{ 1.58 + statusmessages[i] = status; 1.59 + patterns[i] = pattern; 1.60 + strings[i] = string; 1.61 + actualmatches[i] = actualmatch; 1.62 + expectedmatches[i] = expectedmatch; 1.63 + i++; 1.64 +} 1.65 + 1.66 + 1.67 +function test() 1.68 +{ 1.69 + enterFunc ('test'); 1.70 + printBugNumber(BUGNUMBER); 1.71 + printStatus (summary); 1.72 + testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); 1.73 + exitFunc ('test'); 1.74 +}