| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'octal-002.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
var SECTION = "RegExp/octal-002.js"; |
| 17 |
var VERSION = "ECMA_2"; |
| 18 |
var TITLE = "RegExp patterns that contain OctalEscapeSequences"; |
| 19 |
var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346189"; |
| 20 |
|
| 21 |
startTest(); |
| 22 |
|
| 23 |
|
| 24 |
AddRegExpCases( |
| 25 |
/(.)(.)(.)(.)(.)(.)(.)(.)\8/, |
| 26 |
"/(.)(.)(.)(.)(.)(.)(.)(.)\\8", |
| 27 |
"aabbccaaabbbccc", |
| 28 |
"aabbccaaabbbccc", |
| 29 |
0, |
| 30 |
["aabbccaaa", "a", "a", "b", "b", "c", "c", "a", "a"] ); |
| 31 |
|
| 32 |
AddRegExpCases( |
| 33 |
/(.)(.)(.)(.)(.)(.)(.)(.)(.)\9/, |
| 34 |
"/(.)(.)(.)(.)(.)(.)(.)(.)\\9", |
| 35 |
"aabbccaabbcc", |
| 36 |
"aabbccaabbcc", |
| 37 |
0, |
| 38 |
["aabbccaabb", "a", "a", "b", "b", "c", "c", "a", "a", "b"] ); |
| 39 |
|
| 40 |
AddRegExpCases( |
| 41 |
/(.)(.)(.)(.)(.)(.)(.)(.)(.)\8/, |
| 42 |
"/(.)(.)(.)(.)(.)(.)(.)(.)(.)\\8", |
| 43 |
"aabbccaababcc", |
| 44 |
"aabbccaababcc", |
| 45 |
0, |
| 46 |
["aabbccaaba", "a", "a", "b", "b", "c", "c", "a", "a", "b"] ); |
| 47 |
|
| 48 |
test(); |
| 49 |
|
| 50 |
function AddRegExpCases( |
| 51 |
regexp, str_regexp, pattern, str_pattern, index, matches_array ) { |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
if ( regexp.exec(pattern) == null || matches_array == null ) { |
| 56 |
AddTestCase( |
| 57 |
regexp + ".exec(" + str_pattern +")", |
| 58 |
matches_array, |
| 59 |
regexp.exec(pattern) ); |
| 60 |
|
| 61 |
return; |
| 62 |
} |
| 63 |
AddTestCase( |
| 64 |
str_regexp + ".exec(" + str_pattern +").length", |
| 65 |
matches_array.length, |
| 66 |
regexp.exec(pattern).length ); |
| 67 |
|
| 68 |
AddTestCase( |
| 69 |
str_regexp + ".exec(" + str_pattern +").index", |
| 70 |
index, |
| 71 |
regexp.exec(pattern).index ); |
| 72 |
|
| 73 |
AddTestCase( |
| 74 |
str_regexp + ".exec(" + str_pattern +").input", |
| 75 |
pattern, |
| 76 |
regexp.exec(pattern).input ); |
| 77 |
|
| 78 |
AddTestCase( |
| 79 |
str_regexp + ".exec(" + str_pattern +").toString()", |
| 80 |
matches_array.toString(), |
| 81 |
regexp.exec(pattern).toString() ); |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
} |