]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/RegExp/octal-001.js
2 * File Name: RegExp/octal-001.js
4 * Description: Based on ECMA 2 Draft 7 February 1999
5 * Simple test cases for matching OctalEscapeSequences.
6 * Author: christine@netscape.com
7 * Date: 19 February 1999
9 var SECTION
= "RegExp/octal-001.js";
10 var VERSION
= "ECMA_2";
11 var TITLE
= "RegExp patterns that contain OctalEscapeSequences";
12 var BUGNUMBER
="http://scopus/bugsplat/show_bug.cgi?id=346196";
28 function AddRegExpCases(
29 regexp
, str_regexp
, pattern
, str_pattern
, index
, matches_array
) {
31 // prevent a runtime error
33 if ( regexp
.exec(pattern
) == null || matches_array
== null ) {
35 regexp
+ ".exec(" + str_pattern
+")",
37 regexp
.exec(pattern
) );
42 str_regexp
+ ".exec(" + str_pattern
+").length",
44 regexp
.exec(pattern
).length
);
47 str_regexp
+ ".exec(" + str_pattern
+").index",
49 regexp
.exec(pattern
).index
);
52 str_regexp
+ ".exec(" + str_pattern
+").input",
54 regexp
.exec(pattern
).input
);
57 str_regexp
+ ".exec(" + str_pattern
+").toString()",
58 matches_array
.toString(),
59 regexp
.exec(pattern
).toString() );
61 var limit = matches_array.length > regexp.exec(pattern).length
62 ? matches_array.length
63 : regexp.exec(pattern).length;
65 for ( var matches = 0; matches < limit; matches++ ) {
67 str_regexp + ".exec(" + str_pattern +")[" + matches +"]",
68 matches_array[matches],
69 regexp.exec(pattern)[matches] );