js/src/tests/ecma_3/RegExp/perlstress-002.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma_3/RegExp/perlstress-002.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,1808 @@
     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:    2002-07-07
    1.12 + * SUMMARY: Testing JS RegExp engine against Perl 5 RegExp engine.
    1.13 + * Adjust cnLBOUND, cnUBOUND below to restrict which sections are tested.
    1.14 + *
    1.15 + * This test was created by running various patterns and strings through the
    1.16 + * Perl 5 RegExp engine. We saved the results below to test the JS engine.
    1.17 + *
    1.18 + * Each of the examples below is a negative test; that is, each produces a
    1.19 + * null match in Perl. Thus we set |expectedmatch| = |null| in each section.
    1.20 + *
    1.21 + * NOTE: ECMA/JS and Perl do differ on certain points. We have either commented
    1.22 + * out such sections altogether, or modified them to fit what we expect from JS.
    1.23 + *
    1.24 + * EXAMPLES:
    1.25 + *
    1.26 + * - ECMA does support (?: (?= and (?! operators, but doesn't support (?<  etc.
    1.27 + *
    1.28 + * - ECMA doesn't support (?(condition)
    1.29 + *
    1.30 + */
    1.31 +//-----------------------------------------------------------------------------
    1.32 +var i = 0;
    1.33 +var BUGNUMBER = 85721;
    1.34 +var summary = 'Testing regular expression edge cases';
    1.35 +var cnSingleSpace = ' ';
    1.36 +var status = '';
    1.37 +var statusmessages = new Array();
    1.38 +var pattern = '';
    1.39 +var patterns = new Array();
    1.40 +var string = '';
    1.41 +var strings = new Array();
    1.42 +var actualmatch = '';
    1.43 +var actualmatches = new Array();
    1.44 +var expectedmatch = '';
    1.45 +var expectedmatches = new Array();
    1.46 +var cnLBOUND = 0;
    1.47 +var cnUBOUND = 1000;
    1.48 +
    1.49 +
    1.50 +status = inSection(1);
    1.51 +pattern = /abc/;
    1.52 +string = 'xbc';
    1.53 +actualmatch = string.match(pattern);
    1.54 +expectedmatch = null;
    1.55 +addThis();
    1.56 +
    1.57 +status = inSection(2);
    1.58 +pattern = /abc/;
    1.59 +string = 'axc';
    1.60 +actualmatch = string.match(pattern);
    1.61 +expectedmatch = null;
    1.62 +addThis();
    1.63 +
    1.64 +status = inSection(3);
    1.65 +pattern = /abc/;
    1.66 +string = 'abx';
    1.67 +actualmatch = string.match(pattern);
    1.68 +expectedmatch = null;
    1.69 +addThis();
    1.70 +
    1.71 +status = inSection(4);
    1.72 +pattern = /ab+bc/;
    1.73 +string = 'abc';
    1.74 +actualmatch = string.match(pattern);
    1.75 +expectedmatch = null;
    1.76 +addThis();
    1.77 +
    1.78 +status = inSection(5);
    1.79 +pattern = /ab+bc/;
    1.80 +string = 'abq';
    1.81 +actualmatch = string.match(pattern);
    1.82 +expectedmatch = null;
    1.83 +addThis();
    1.84 +
    1.85 +status = inSection(6);
    1.86 +pattern = /ab{1,}bc/;
    1.87 +string = 'abq';
    1.88 +actualmatch = string.match(pattern);
    1.89 +expectedmatch = null;
    1.90 +addThis();
    1.91 +
    1.92 +status = inSection(7);
    1.93 +pattern = /ab{4,5}bc/;
    1.94 +string = 'abbbbc';
    1.95 +actualmatch = string.match(pattern);
    1.96 +expectedmatch = null;
    1.97 +addThis();
    1.98 +
    1.99 +status = inSection(8);
   1.100 +pattern = /ab?bc/;
   1.101 +string = 'abbbbc';
   1.102 +actualmatch = string.match(pattern);
   1.103 +expectedmatch = null;
   1.104 +addThis();
   1.105 +
   1.106 +status = inSection(9);
   1.107 +pattern = /^abc$/;
   1.108 +string = 'abcc';
   1.109 +actualmatch = string.match(pattern);
   1.110 +expectedmatch = null;
   1.111 +addThis();
   1.112 +
   1.113 +status = inSection(10);
   1.114 +pattern = /^abc$/;
   1.115 +string = 'aabc';
   1.116 +actualmatch = string.match(pattern);
   1.117 +expectedmatch = null;
   1.118 +addThis();
   1.119 +
   1.120 +status = inSection(11);
   1.121 +pattern = /abc$/;
   1.122 +string = 'aabcd';
   1.123 +actualmatch = string.match(pattern);
   1.124 +expectedmatch = null;
   1.125 +addThis();
   1.126 +
   1.127 +status = inSection(12);
   1.128 +pattern = /a.*c/;
   1.129 +string = 'axyzd';
   1.130 +actualmatch = string.match(pattern);
   1.131 +expectedmatch = null;
   1.132 +addThis();
   1.133 +
   1.134 +status = inSection(13);
   1.135 +pattern = /a[bc]d/;
   1.136 +string = 'abc';
   1.137 +actualmatch = string.match(pattern);
   1.138 +expectedmatch = null;
   1.139 +addThis();
   1.140 +
   1.141 +status = inSection(14);
   1.142 +pattern = /a[b-d]e/;
   1.143 +string = 'abd';
   1.144 +actualmatch = string.match(pattern);
   1.145 +expectedmatch = null;
   1.146 +addThis();
   1.147 +
   1.148 +status = inSection(15);
   1.149 +pattern = /a[^bc]d/;
   1.150 +string = 'abd';
   1.151 +actualmatch = string.match(pattern);
   1.152 +expectedmatch = null;
   1.153 +addThis();
   1.154 +
   1.155 +status = inSection(16);
   1.156 +pattern = /a[^-b]c/;
   1.157 +string = 'a-c';
   1.158 +actualmatch = string.match(pattern);
   1.159 +expectedmatch = null;
   1.160 +addThis();
   1.161 +
   1.162 +status = inSection(17);
   1.163 +pattern = /a[^]b]c/;
   1.164 +string = 'a]c';
   1.165 +actualmatch = string.match(pattern);
   1.166 +expectedmatch = null;
   1.167 +addThis();
   1.168 +
   1.169 +status = inSection(18);
   1.170 +pattern = /\by\b/;
   1.171 +string = 'xy';
   1.172 +actualmatch = string.match(pattern);
   1.173 +expectedmatch = null;
   1.174 +addThis();
   1.175 +
   1.176 +status = inSection(19);
   1.177 +pattern = /\by\b/;
   1.178 +string = 'yz';
   1.179 +actualmatch = string.match(pattern);
   1.180 +expectedmatch = null;
   1.181 +addThis();
   1.182 +
   1.183 +status = inSection(20);
   1.184 +pattern = /\by\b/;
   1.185 +string = 'xyz';
   1.186 +actualmatch = string.match(pattern);
   1.187 +expectedmatch = null;
   1.188 +addThis();
   1.189 +
   1.190 +status = inSection(21);
   1.191 +pattern = /\Ba\B/;
   1.192 +string = 'a-';
   1.193 +actualmatch = string.match(pattern);
   1.194 +expectedmatch = null;
   1.195 +addThis();
   1.196 +
   1.197 +status = inSection(22);
   1.198 +pattern = /\Ba\B/;
   1.199 +string = '-a';
   1.200 +actualmatch = string.match(pattern);
   1.201 +expectedmatch = null;
   1.202 +addThis();
   1.203 +
   1.204 +status = inSection(23);
   1.205 +pattern = /\Ba\B/;
   1.206 +string = '-a-';
   1.207 +actualmatch = string.match(pattern);
   1.208 +expectedmatch = null;
   1.209 +addThis();
   1.210 +
   1.211 +status = inSection(24);
   1.212 +pattern = /\w/;
   1.213 +string = '-';
   1.214 +actualmatch = string.match(pattern);
   1.215 +expectedmatch = null;
   1.216 +addThis();
   1.217 +
   1.218 +status = inSection(25);
   1.219 +pattern = /\W/;
   1.220 +string = 'a';
   1.221 +actualmatch = string.match(pattern);
   1.222 +expectedmatch = null;
   1.223 +addThis();
   1.224 +
   1.225 +status = inSection(26);
   1.226 +pattern = /a\sb/;
   1.227 +string = 'a-b';
   1.228 +actualmatch = string.match(pattern);
   1.229 +expectedmatch = null;
   1.230 +addThis();
   1.231 +
   1.232 +status = inSection(27);
   1.233 +pattern = /\d/;
   1.234 +string = '-';
   1.235 +actualmatch = string.match(pattern);
   1.236 +expectedmatch = null;
   1.237 +addThis();
   1.238 +
   1.239 +status = inSection(28);
   1.240 +pattern = /\D/;
   1.241 +string = '1';
   1.242 +actualmatch = string.match(pattern);
   1.243 +expectedmatch = null;
   1.244 +addThis();
   1.245 +
   1.246 +status = inSection(29);
   1.247 +pattern = /[\w]/;
   1.248 +string = '-';
   1.249 +actualmatch = string.match(pattern);
   1.250 +expectedmatch = null;
   1.251 +addThis();
   1.252 +
   1.253 +status = inSection(30);
   1.254 +pattern = /[\W]/;
   1.255 +string = 'a';
   1.256 +actualmatch = string.match(pattern);
   1.257 +expectedmatch = null;
   1.258 +addThis();
   1.259 +
   1.260 +status = inSection(31);
   1.261 +pattern = /a[\s]b/;
   1.262 +string = 'a-b';
   1.263 +actualmatch = string.match(pattern);
   1.264 +expectedmatch = null;
   1.265 +addThis();
   1.266 +
   1.267 +status = inSection(32);
   1.268 +pattern = /[\d]/;
   1.269 +string = '-';
   1.270 +actualmatch = string.match(pattern);
   1.271 +expectedmatch = null;
   1.272 +addThis();
   1.273 +
   1.274 +status = inSection(33);
   1.275 +pattern = /[\D]/;
   1.276 +string = '1';
   1.277 +actualmatch = string.match(pattern);
   1.278 +expectedmatch = null;
   1.279 +addThis();
   1.280 +
   1.281 +status = inSection(34);
   1.282 +pattern = /$b/;
   1.283 +string = 'b';
   1.284 +actualmatch = string.match(pattern);
   1.285 +expectedmatch = null;
   1.286 +addThis();
   1.287 +
   1.288 +status = inSection(35);
   1.289 +pattern = /^(ab|cd)e/;
   1.290 +string = 'abcde';
   1.291 +actualmatch = string.match(pattern);
   1.292 +expectedmatch = null;
   1.293 +addThis();
   1.294 +
   1.295 +status = inSection(36);
   1.296 +pattern = /a[bcd]+dcdcde/;
   1.297 +string = 'adcdcde';
   1.298 +actualmatch = string.match(pattern);
   1.299 +expectedmatch = null;
   1.300 +addThis();
   1.301 +
   1.302 +status = inSection(37);
   1.303 +pattern = /(bc+d$|ef*g.|h?i(j|k))/;
   1.304 +string = 'effg';
   1.305 +actualmatch = string.match(pattern);
   1.306 +expectedmatch = null;
   1.307 +addThis();
   1.308 +
   1.309 +status = inSection(38);
   1.310 +pattern = /(bc+d$|ef*g.|h?i(j|k))/;
   1.311 +string = 'bcdd';
   1.312 +actualmatch = string.match(pattern);
   1.313 +expectedmatch = null;
   1.314 +addThis();
   1.315 +
   1.316 +status = inSection(39);
   1.317 +pattern = /[k]/;
   1.318 +string = 'ab';
   1.319 +actualmatch = string.match(pattern);
   1.320 +expectedmatch = null;
   1.321 +addThis();
   1.322 +
   1.323 +// MODIFIED - ECMA has different rules for paren contents.
   1.324 +status = inSection(40);
   1.325 +pattern = /(a)|\1/;
   1.326 +string = 'x';
   1.327 +actualmatch = string.match(pattern);
   1.328 +//expectedmatch = null;
   1.329 +expectedmatch = Array("", undefined);
   1.330 +addThis();
   1.331 +
   1.332 +// MODIFIED - ECMA has different rules for paren contents.
   1.333 +status = inSection(41);
   1.334 +pattern = /((\3|b)\2(a)x)+/;
   1.335 +string = 'aaxabxbaxbbx';
   1.336 +actualmatch = string.match(pattern);
   1.337 +//expectedmatch = null;
   1.338 +expectedmatch = Array("ax", "ax", "", "a");
   1.339 +addThis();
   1.340 +
   1.341 +status = inSection(42);
   1.342 +pattern = /abc/i;
   1.343 +string = 'XBC';
   1.344 +actualmatch = string.match(pattern);
   1.345 +expectedmatch = null;
   1.346 +addThis();
   1.347 +
   1.348 +status = inSection(43);
   1.349 +pattern = /abc/i;
   1.350 +string = 'AXC';
   1.351 +actualmatch = string.match(pattern);
   1.352 +expectedmatch = null;
   1.353 +addThis();
   1.354 +
   1.355 +status = inSection(44);
   1.356 +pattern = /abc/i;
   1.357 +string = 'ABX';
   1.358 +actualmatch = string.match(pattern);
   1.359 +expectedmatch = null;
   1.360 +addThis();
   1.361 +
   1.362 +status = inSection(45);
   1.363 +pattern = /ab+bc/i;
   1.364 +string = 'ABC';
   1.365 +actualmatch = string.match(pattern);
   1.366 +expectedmatch = null;
   1.367 +addThis();
   1.368 +
   1.369 +status = inSection(46);
   1.370 +pattern = /ab+bc/i;
   1.371 +string = 'ABQ';
   1.372 +actualmatch = string.match(pattern);
   1.373 +expectedmatch = null;
   1.374 +addThis();
   1.375 +
   1.376 +status = inSection(47);
   1.377 +pattern = /ab{1,}bc/i;
   1.378 +string = 'ABQ';
   1.379 +actualmatch = string.match(pattern);
   1.380 +expectedmatch = null;
   1.381 +addThis();
   1.382 +
   1.383 +status = inSection(48);
   1.384 +pattern = /ab{4,5}?bc/i;
   1.385 +string = 'ABBBBC';
   1.386 +actualmatch = string.match(pattern);
   1.387 +expectedmatch = null;
   1.388 +addThis();
   1.389 +
   1.390 +status = inSection(49);
   1.391 +pattern = /ab??bc/i;
   1.392 +string = 'ABBBBC';
   1.393 +actualmatch = string.match(pattern);
   1.394 +expectedmatch = null;
   1.395 +addThis();
   1.396 +
   1.397 +status = inSection(50);
   1.398 +pattern = /^abc$/i;
   1.399 +string = 'ABCC';
   1.400 +actualmatch = string.match(pattern);
   1.401 +expectedmatch = null;
   1.402 +addThis();
   1.403 +
   1.404 +status = inSection(51);
   1.405 +pattern = /^abc$/i;
   1.406 +string = 'AABC';
   1.407 +actualmatch = string.match(pattern);
   1.408 +expectedmatch = null;
   1.409 +addThis();
   1.410 +
   1.411 +status = inSection(52);
   1.412 +pattern = /a.*c/i;
   1.413 +string = 'AXYZD';
   1.414 +actualmatch = string.match(pattern);
   1.415 +expectedmatch = null;
   1.416 +addThis();
   1.417 +
   1.418 +status = inSection(53);
   1.419 +pattern = /a[bc]d/i;
   1.420 +string = 'ABC';
   1.421 +actualmatch = string.match(pattern);
   1.422 +expectedmatch = null;
   1.423 +addThis();
   1.424 +
   1.425 +status = inSection(54);
   1.426 +pattern = /a[b-d]e/i;
   1.427 +string = 'ABD';
   1.428 +actualmatch = string.match(pattern);
   1.429 +expectedmatch = null;
   1.430 +addThis();
   1.431 +
   1.432 +status = inSection(55);
   1.433 +pattern = /a[^bc]d/i;
   1.434 +string = 'ABD';
   1.435 +actualmatch = string.match(pattern);
   1.436 +expectedmatch = null;
   1.437 +addThis();
   1.438 +
   1.439 +status = inSection(56);
   1.440 +pattern = /a[^-b]c/i;
   1.441 +string = 'A-C';
   1.442 +actualmatch = string.match(pattern);
   1.443 +expectedmatch = null;
   1.444 +addThis();
   1.445 +
   1.446 +status = inSection(57);
   1.447 +pattern = /a[^]b]c/i;
   1.448 +string = 'A]C';
   1.449 +actualmatch = string.match(pattern);
   1.450 +expectedmatch = null;
   1.451 +addThis();
   1.452 +
   1.453 +status = inSection(58);
   1.454 +pattern = /$b/i;
   1.455 +string = 'B';
   1.456 +actualmatch = string.match(pattern);
   1.457 +expectedmatch = null;
   1.458 +addThis();
   1.459 +
   1.460 +status = inSection(59);
   1.461 +pattern = /^(ab|cd)e/i;
   1.462 +string = 'ABCDE';
   1.463 +actualmatch = string.match(pattern);
   1.464 +expectedmatch = null;
   1.465 +addThis();
   1.466 +
   1.467 +status = inSection(60);
   1.468 +pattern = /a[bcd]+dcdcde/i;
   1.469 +string = 'ADCDCDE';
   1.470 +actualmatch = string.match(pattern);
   1.471 +expectedmatch = null;
   1.472 +addThis();
   1.473 +
   1.474 +status = inSection(61);
   1.475 +pattern = /(bc+d$|ef*g.|h?i(j|k))/i;
   1.476 +string = 'EFFG';
   1.477 +actualmatch = string.match(pattern);
   1.478 +expectedmatch = null;
   1.479 +addThis();
   1.480 +
   1.481 +status = inSection(62);
   1.482 +pattern = /(bc+d$|ef*g.|h?i(j|k))/i;
   1.483 +string = 'BCDD';
   1.484 +actualmatch = string.match(pattern);
   1.485 +expectedmatch = null;
   1.486 +addThis();
   1.487 +
   1.488 +status = inSection(63);
   1.489 +pattern = /[k]/i;
   1.490 +string = 'AB';
   1.491 +actualmatch = string.match(pattern);
   1.492 +expectedmatch = null;
   1.493 +addThis();
   1.494 +
   1.495 +status = inSection(64);
   1.496 +pattern = /^(a\1?){4}$/;
   1.497 +string = 'aaaaaaaaa';
   1.498 +actualmatch = string.match(pattern);
   1.499 +expectedmatch = null;
   1.500 +addThis();
   1.501 +
   1.502 +status = inSection(65);
   1.503 +pattern = /^(a\1?){4}$/;
   1.504 +string = 'aaaaaaaaaaa';
   1.505 +actualmatch = string.match(pattern);
   1.506 +expectedmatch = null;
   1.507 +addThis();
   1.508 +
   1.509 +/* ECMA doesn't support (?(
   1.510 +   status = inSection(66);
   1.511 +   pattern = /^(a(?(1)\1)){4}$/;
   1.512 +   string = 'aaaaaaaaa';
   1.513 +   actualmatch = string.match(pattern);
   1.514 +   expectedmatch = null;
   1.515 +   addThis();
   1.516 +
   1.517 +   status = inSection(67);
   1.518 +   pattern = /^(a(?(1)\1)){4}$/;
   1.519 +   string = 'aaaaaaaaaaa';
   1.520 +   actualmatch = string.match(pattern);
   1.521 +   expectedmatch = null;
   1.522 +   addThis();
   1.523 +*/
   1.524 +
   1.525 +/* ECMA doesn't support (?<
   1.526 +   status = inSection(68);
   1.527 +   pattern = /(?<=a)b/;
   1.528 +   string = 'cb';
   1.529 +   actualmatch = string.match(pattern);
   1.530 +   expectedmatch = null;
   1.531 +   addThis();
   1.532 +
   1.533 +   status = inSection(69);
   1.534 +   pattern = /(?<=a)b/;
   1.535 +   string = 'b';
   1.536 +   actualmatch = string.match(pattern);
   1.537 +   expectedmatch = null;
   1.538 +   addThis();
   1.539 +
   1.540 +   status = inSection(70);
   1.541 +   pattern = /(?<!c)b/;
   1.542 +   string = 'cb';
   1.543 +   actualmatch = string.match(pattern);
   1.544 +   expectedmatch = null;
   1.545 +   addThis();
   1.546 +*/
   1.547 +
   1.548 +/* ECMA doesn't support (?(condition)
   1.549 +   status = inSection(71);
   1.550 +   pattern = /(?:(?i)a)b/;
   1.551 +   string = 'aB';
   1.552 +   actualmatch = string.match(pattern);
   1.553 +   expectedmatch = null;
   1.554 +   addThis();
   1.555 +
   1.556 +   status = inSection(72);
   1.557 +   pattern = /((?i)a)b/;
   1.558 +   string = 'aB';
   1.559 +   actualmatch = string.match(pattern);
   1.560 +   expectedmatch = null;
   1.561 +   addThis();
   1.562 +
   1.563 +   status = inSection(73);
   1.564 +   pattern = /(?i:a)b/;
   1.565 +   string = 'aB';
   1.566 +   actualmatch = string.match(pattern);
   1.567 +   expectedmatch = null;
   1.568 +   addThis();
   1.569 +
   1.570 +   status = inSection(74);
   1.571 +   pattern = /((?i:a))b/;
   1.572 +   string = 'aB';
   1.573 +   actualmatch = string.match(pattern);
   1.574 +   expectedmatch = null;
   1.575 +   addThis();
   1.576 +
   1.577 +   status = inSection(75);
   1.578 +   pattern = /(?:(?-i)a)b/i;
   1.579 +   string = 'Ab';
   1.580 +   actualmatch = string.match(pattern);
   1.581 +   expectedmatch = null;
   1.582 +   addThis();
   1.583 +
   1.584 +   status = inSection(76);
   1.585 +   pattern = /((?-i)a)b/i;
   1.586 +   string = 'Ab';
   1.587 +   actualmatch = string.match(pattern);
   1.588 +   expectedmatch = null;
   1.589 +   addThis();
   1.590 +
   1.591 +   status = inSection(77);
   1.592 +   pattern = /(?:(?-i)a)b/i;
   1.593 +   string = 'AB';
   1.594 +   actualmatch = string.match(pattern);
   1.595 +   expectedmatch = null;
   1.596 +   addThis();
   1.597 +
   1.598 +   status = inSection(78);
   1.599 +   pattern = /((?-i)a)b/i;
   1.600 +   string = 'AB';
   1.601 +   actualmatch = string.match(pattern);
   1.602 +   expectedmatch = null;
   1.603 +   addThis();
   1.604 +
   1.605 +   status = inSection(79);
   1.606 +   pattern = /(?-i:a)b/i;
   1.607 +   string = 'Ab';
   1.608 +   actualmatch = string.match(pattern);
   1.609 +   expectedmatch = null;
   1.610 +   addThis();
   1.611 +
   1.612 +   status = inSection(80);
   1.613 +   pattern = /((?-i:a))b/i;
   1.614 +   string = 'Ab';
   1.615 +   actualmatch = string.match(pattern);
   1.616 +   expectedmatch = null;
   1.617 +   addThis();
   1.618 +
   1.619 +   status = inSection(81);
   1.620 +   pattern = /(?-i:a)b/i;
   1.621 +   string = 'AB';
   1.622 +   actualmatch = string.match(pattern);
   1.623 +   expectedmatch = null;
   1.624 +   addThis();
   1.625 +
   1.626 +   status = inSection(82);
   1.627 +   pattern = /((?-i:a))b/i;
   1.628 +   string = 'AB';
   1.629 +   actualmatch = string.match(pattern);
   1.630 +   expectedmatch = null;
   1.631 +   addThis();
   1.632 +
   1.633 +   status = inSection(83);
   1.634 +   pattern = /((?-i:a.))b/i;
   1.635 +   string = 'a\nB';
   1.636 +   actualmatch = string.match(pattern);
   1.637 +   expectedmatch = null;
   1.638 +   addThis();
   1.639 +
   1.640 +   status = inSection(84);
   1.641 +   pattern = /((?s-i:a.))b/i;
   1.642 +   string = 'B\nB';
   1.643 +   actualmatch = string.match(pattern);
   1.644 +   expectedmatch = null;
   1.645 +   addThis();
   1.646 +*/
   1.647 +
   1.648 +/* ECMA doesn't support (?<
   1.649 +   status = inSection(85);
   1.650 +   pattern = /(?<![cd])b/;
   1.651 +   string = 'dbcb';
   1.652 +   actualmatch = string.match(pattern);
   1.653 +   expectedmatch = null;
   1.654 +   addThis();
   1.655 +
   1.656 +   status = inSection(86);
   1.657 +   pattern = /(?<!(c|d))b/;
   1.658 +   string = 'dbcb';
   1.659 +   actualmatch = string.match(pattern);
   1.660 +   expectedmatch = null;
   1.661 +   addThis();
   1.662 +*/
   1.663 +
   1.664 +status = inSection(87);
   1.665 +pattern = /^(?:a?b?)*$/;
   1.666 +string = 'a--';
   1.667 +actualmatch = string.match(pattern);
   1.668 +expectedmatch = null;
   1.669 +addThis();
   1.670 +
   1.671 +status = inSection(88);
   1.672 +pattern = /^b/;
   1.673 +string = 'a\nb\nc\n';
   1.674 +actualmatch = string.match(pattern);
   1.675 +expectedmatch = null;
   1.676 +addThis();
   1.677 +
   1.678 +status = inSection(89);
   1.679 +pattern = /()^b/;
   1.680 +string = 'a\nb\nc\n';
   1.681 +actualmatch = string.match(pattern);
   1.682 +expectedmatch = null;
   1.683 +addThis();
   1.684 +
   1.685 +/* ECMA doesn't support (?(
   1.686 +   status = inSection(90);
   1.687 +   pattern = /(?(1)a|b)/;
   1.688 +   string = 'a';
   1.689 +   actualmatch = string.match(pattern);
   1.690 +   expectedmatch = null;
   1.691 +   addThis();
   1.692 +
   1.693 +   status = inSection(91);
   1.694 +   pattern = /(x)?(?(1)a|b)/;
   1.695 +   string = 'a';
   1.696 +   actualmatch = string.match(pattern);
   1.697 +   expectedmatch = null;
   1.698 +   addThis();
   1.699 +
   1.700 +   status = inSection(92);
   1.701 +   pattern = /()(?(1)b|a)/;
   1.702 +   string = 'a';
   1.703 +   actualmatch = string.match(pattern);
   1.704 +   expectedmatch = null;
   1.705 +   addThis();
   1.706 +
   1.707 +   status = inSection(93);
   1.708 +   pattern = /^(\()?blah(?(1)(\)))$/;
   1.709 +   string = 'blah)';
   1.710 +   actualmatch = string.match(pattern);
   1.711 +   expectedmatch = null;
   1.712 +   addThis();
   1.713 +
   1.714 +   status = inSection(94);
   1.715 +   pattern = /^(\()?blah(?(1)(\)))$/;
   1.716 +   string = '(blah';
   1.717 +   actualmatch = string.match(pattern);
   1.718 +   expectedmatch = null;
   1.719 +   addThis();
   1.720 +
   1.721 +   status = inSection(95);
   1.722 +   pattern = /^(\(+)?blah(?(1)(\)))$/;
   1.723 +   string = 'blah)';
   1.724 +   actualmatch = string.match(pattern);
   1.725 +   expectedmatch = null;
   1.726 +   addThis();
   1.727 +
   1.728 +   status = inSection(96);
   1.729 +   pattern = /^(\(+)?blah(?(1)(\)))$/;
   1.730 +   string = '(blah';
   1.731 +   actualmatch = string.match(pattern);
   1.732 +   expectedmatch = null;
   1.733 +   addThis();
   1.734 +
   1.735 +   status = inSection(97);
   1.736 +   pattern = /(?(?{0})a|b)/;
   1.737 +   string = 'a';
   1.738 +   actualmatch = string.match(pattern);
   1.739 +   expectedmatch = null;
   1.740 +   addThis();
   1.741 +
   1.742 +   status = inSection(98);
   1.743 +   pattern = /(?(?{1})b|a)/;
   1.744 +   string = 'a';
   1.745 +   actualmatch = string.match(pattern);
   1.746 +   expectedmatch = null;
   1.747 +   addThis();
   1.748 +
   1.749 +   status = inSection(99);
   1.750 +   pattern = /(?(?!a)a|b)/;
   1.751 +   string = 'a';
   1.752 +   actualmatch = string.match(pattern);
   1.753 +   expectedmatch = null;
   1.754 +   addThis();
   1.755 +
   1.756 +   status = inSection(100);
   1.757 +   pattern = /(?(?=a)b|a)/;
   1.758 +   string = 'a';
   1.759 +   actualmatch = string.match(pattern);
   1.760 +   expectedmatch = null;
   1.761 +   addThis();
   1.762 +*/
   1.763 +
   1.764 +status = inSection(101);
   1.765 +pattern = /^(?=(a+?))\1ab/;
   1.766 +string = 'aaab';
   1.767 +actualmatch = string.match(pattern);
   1.768 +expectedmatch = null;
   1.769 +addThis();
   1.770 +
   1.771 +status = inSection(102);
   1.772 +pattern = /^(?=(a+?))\1ab/;
   1.773 +string = 'aaab';
   1.774 +actualmatch = string.match(pattern);
   1.775 +expectedmatch = null;
   1.776 +addThis();
   1.777 +
   1.778 +status = inSection(103);
   1.779 +pattern = /([\w:]+::)?(\w+)$/;
   1.780 +string = 'abcd:';
   1.781 +actualmatch = string.match(pattern);
   1.782 +expectedmatch = null;
   1.783 +addThis();
   1.784 +
   1.785 +status = inSection(104);
   1.786 +pattern = /([\w:]+::)?(\w+)$/;
   1.787 +string = 'abcd:';
   1.788 +actualmatch = string.match(pattern);
   1.789 +expectedmatch = null;
   1.790 +addThis();
   1.791 +
   1.792 +status = inSection(105);
   1.793 +pattern = /(>a+)ab/;
   1.794 +string = 'aaab';
   1.795 +actualmatch = string.match(pattern);
   1.796 +expectedmatch = null;
   1.797 +addThis();
   1.798 +
   1.799 +status = inSection(106);
   1.800 +pattern = /a\Z/;
   1.801 +string = 'a\nb\n';
   1.802 +actualmatch = string.match(pattern);
   1.803 +expectedmatch = null;
   1.804 +addThis();
   1.805 +
   1.806 +status = inSection(107);
   1.807 +pattern = /a\z/;
   1.808 +string = 'a\nb\n';
   1.809 +actualmatch = string.match(pattern);
   1.810 +expectedmatch = null;
   1.811 +addThis();
   1.812 +
   1.813 +status = inSection(108);
   1.814 +pattern = /a$/;
   1.815 +string = 'a\nb\n';
   1.816 +actualmatch = string.match(pattern);
   1.817 +expectedmatch = null;
   1.818 +addThis();
   1.819 +
   1.820 +status = inSection(109);
   1.821 +pattern = /a\z/;
   1.822 +string = 'b\na\n';
   1.823 +actualmatch = string.match(pattern);
   1.824 +expectedmatch = null;
   1.825 +addThis();
   1.826 +
   1.827 +status = inSection(110);
   1.828 +pattern = /a\z/m;
   1.829 +string = 'a\nb\n';
   1.830 +actualmatch = string.match(pattern);
   1.831 +expectedmatch = null;
   1.832 +addThis();
   1.833 +
   1.834 +status = inSection(111);
   1.835 +pattern = /a\z/m;
   1.836 +string = 'b\na\n';
   1.837 +actualmatch = string.match(pattern);
   1.838 +expectedmatch = null;
   1.839 +addThis();
   1.840 +
   1.841 +status = inSection(112);
   1.842 +pattern = /aa\Z/;
   1.843 +string = 'aa\nb\n';
   1.844 +actualmatch = string.match(pattern);
   1.845 +expectedmatch = null;
   1.846 +addThis();
   1.847 +
   1.848 +status = inSection(113);
   1.849 +pattern = /aa\z/;
   1.850 +string = 'aa\nb\n';
   1.851 +actualmatch = string.match(pattern);
   1.852 +expectedmatch = null;
   1.853 +addThis();
   1.854 +
   1.855 +status = inSection(114);
   1.856 +pattern = /aa$/;
   1.857 +string = 'aa\nb\n';
   1.858 +actualmatch = string.match(pattern);
   1.859 +expectedmatch = null;
   1.860 +addThis();
   1.861 +
   1.862 +status = inSection(115);
   1.863 +pattern = /aa\z/;
   1.864 +string = 'b\naa\n';
   1.865 +actualmatch = string.match(pattern);
   1.866 +expectedmatch = null;
   1.867 +addThis();
   1.868 +
   1.869 +status = inSection(116);
   1.870 +pattern = /aa\z/m;
   1.871 +string = 'aa\nb\n';
   1.872 +actualmatch = string.match(pattern);
   1.873 +expectedmatch = null;
   1.874 +addThis();
   1.875 +
   1.876 +status = inSection(117);
   1.877 +pattern = /aa\z/m;
   1.878 +string = 'b\naa\n';
   1.879 +actualmatch = string.match(pattern);
   1.880 +expectedmatch = null;
   1.881 +addThis();
   1.882 +
   1.883 +status = inSection(118);
   1.884 +pattern = /aa\Z/;
   1.885 +string = 'ac\nb\n';
   1.886 +actualmatch = string.match(pattern);
   1.887 +expectedmatch = null;
   1.888 +addThis();
   1.889 +
   1.890 +status = inSection(119);
   1.891 +pattern = /aa\z/;
   1.892 +string = 'ac\nb\n';
   1.893 +actualmatch = string.match(pattern);
   1.894 +expectedmatch = null;
   1.895 +addThis();
   1.896 +
   1.897 +status = inSection(120);
   1.898 +pattern = /aa$/;
   1.899 +string = 'ac\nb\n';
   1.900 +actualmatch = string.match(pattern);
   1.901 +expectedmatch = null;
   1.902 +addThis();
   1.903 +
   1.904 +status = inSection(121);
   1.905 +pattern = /aa\Z/;
   1.906 +string = 'b\nac\n';
   1.907 +actualmatch = string.match(pattern);
   1.908 +expectedmatch = null;
   1.909 +addThis();
   1.910 +
   1.911 +status = inSection(122);
   1.912 +pattern = /aa\z/;
   1.913 +string = 'b\nac\n';
   1.914 +actualmatch = string.match(pattern);
   1.915 +expectedmatch = null;
   1.916 +addThis();
   1.917 +
   1.918 +status = inSection(123);
   1.919 +pattern = /aa$/;
   1.920 +string = 'b\nac\n';
   1.921 +actualmatch = string.match(pattern);
   1.922 +expectedmatch = null;
   1.923 +addThis();
   1.924 +
   1.925 +status = inSection(124);
   1.926 +pattern = /aa\Z/;
   1.927 +string = 'b\nac';
   1.928 +actualmatch = string.match(pattern);
   1.929 +expectedmatch = null;
   1.930 +addThis();
   1.931 +
   1.932 +status = inSection(125);
   1.933 +pattern = /aa\z/;
   1.934 +string = 'b\nac';
   1.935 +actualmatch = string.match(pattern);
   1.936 +expectedmatch = null;
   1.937 +addThis();
   1.938 +
   1.939 +status = inSection(126);
   1.940 +pattern = /aa$/;
   1.941 +string = 'b\nac';
   1.942 +actualmatch = string.match(pattern);
   1.943 +expectedmatch = null;
   1.944 +addThis();
   1.945 +
   1.946 +status = inSection(127);
   1.947 +pattern = /aa\Z/m;
   1.948 +string = 'ac\nb\n';
   1.949 +actualmatch = string.match(pattern);
   1.950 +expectedmatch = null;
   1.951 +addThis();
   1.952 +
   1.953 +status = inSection(128);
   1.954 +pattern = /aa\z/m;
   1.955 +string = 'ac\nb\n';
   1.956 +actualmatch = string.match(pattern);
   1.957 +expectedmatch = null;
   1.958 +addThis();
   1.959 +
   1.960 +status = inSection(129);
   1.961 +pattern = /aa$/m;
   1.962 +string = 'ac\nb\n';
   1.963 +actualmatch = string.match(pattern);
   1.964 +expectedmatch = null;
   1.965 +addThis();
   1.966 +
   1.967 +status = inSection(130);
   1.968 +pattern = /aa\Z/m;
   1.969 +string = 'b\nac\n';
   1.970 +actualmatch = string.match(pattern);
   1.971 +expectedmatch = null;
   1.972 +addThis();
   1.973 +
   1.974 +status = inSection(131);
   1.975 +pattern = /aa\z/m;
   1.976 +string = 'b\nac\n';
   1.977 +actualmatch = string.match(pattern);
   1.978 +expectedmatch = null;
   1.979 +addThis();
   1.980 +
   1.981 +status = inSection(132);
   1.982 +pattern = /aa$/m;
   1.983 +string = 'b\nac\n';
   1.984 +actualmatch = string.match(pattern);
   1.985 +expectedmatch = null;
   1.986 +addThis();
   1.987 +
   1.988 +status = inSection(133);
   1.989 +pattern = /aa\Z/m;
   1.990 +string = 'b\nac';
   1.991 +actualmatch = string.match(pattern);
   1.992 +expectedmatch = null;
   1.993 +addThis();
   1.994 +
   1.995 +status = inSection(134);
   1.996 +pattern = /aa\z/m;
   1.997 +string = 'b\nac';
   1.998 +actualmatch = string.match(pattern);
   1.999 +expectedmatch = null;
  1.1000 +addThis();
  1.1001 +
  1.1002 +status = inSection(135);
  1.1003 +pattern = /aa$/m;
  1.1004 +string = 'b\nac';
  1.1005 +actualmatch = string.match(pattern);
  1.1006 +expectedmatch = null;
  1.1007 +addThis();
  1.1008 +
  1.1009 +status = inSection(136);
  1.1010 +pattern = /aa\Z/;
  1.1011 +string = 'ca\nb\n';
  1.1012 +actualmatch = string.match(pattern);
  1.1013 +expectedmatch = null;
  1.1014 +addThis();
  1.1015 +
  1.1016 +status = inSection(137);
  1.1017 +pattern = /aa\z/;
  1.1018 +string = 'ca\nb\n';
  1.1019 +actualmatch = string.match(pattern);
  1.1020 +expectedmatch = null;
  1.1021 +addThis();
  1.1022 +
  1.1023 +status = inSection(138);
  1.1024 +pattern = /aa$/;
  1.1025 +string = 'ca\nb\n';
  1.1026 +actualmatch = string.match(pattern);
  1.1027 +expectedmatch = null;
  1.1028 +addThis();
  1.1029 +
  1.1030 +status = inSection(139);
  1.1031 +pattern = /aa\Z/;
  1.1032 +string = 'b\nca\n';
  1.1033 +actualmatch = string.match(pattern);
  1.1034 +expectedmatch = null;
  1.1035 +addThis();
  1.1036 +
  1.1037 +status = inSection(140);
  1.1038 +pattern = /aa\z/;
  1.1039 +string = 'b\nca\n';
  1.1040 +actualmatch = string.match(pattern);
  1.1041 +expectedmatch = null;
  1.1042 +addThis();
  1.1043 +
  1.1044 +status = inSection(141);
  1.1045 +pattern = /aa$/;
  1.1046 +string = 'b\nca\n';
  1.1047 +actualmatch = string.match(pattern);
  1.1048 +expectedmatch = null;
  1.1049 +addThis();
  1.1050 +
  1.1051 +status = inSection(142);
  1.1052 +pattern = /aa\Z/;
  1.1053 +string = 'b\nca';
  1.1054 +actualmatch = string.match(pattern);
  1.1055 +expectedmatch = null;
  1.1056 +addThis();
  1.1057 +
  1.1058 +status = inSection(143);
  1.1059 +pattern = /aa\z/;
  1.1060 +string = 'b\nca';
  1.1061 +actualmatch = string.match(pattern);
  1.1062 +expectedmatch = null;
  1.1063 +addThis();
  1.1064 +
  1.1065 +status = inSection(144);
  1.1066 +pattern = /aa$/;
  1.1067 +string = 'b\nca';
  1.1068 +actualmatch = string.match(pattern);
  1.1069 +expectedmatch = null;
  1.1070 +addThis();
  1.1071 +
  1.1072 +status = inSection(145);
  1.1073 +pattern = /aa\Z/m;
  1.1074 +string = 'ca\nb\n';
  1.1075 +actualmatch = string.match(pattern);
  1.1076 +expectedmatch = null;
  1.1077 +addThis();
  1.1078 +
  1.1079 +status = inSection(146);
  1.1080 +pattern = /aa\z/m;
  1.1081 +string = 'ca\nb\n';
  1.1082 +actualmatch = string.match(pattern);
  1.1083 +expectedmatch = null;
  1.1084 +addThis();
  1.1085 +
  1.1086 +status = inSection(147);
  1.1087 +pattern = /aa$/m;
  1.1088 +string = 'ca\nb\n';
  1.1089 +actualmatch = string.match(pattern);
  1.1090 +expectedmatch = null;
  1.1091 +addThis();
  1.1092 +
  1.1093 +status = inSection(148);
  1.1094 +pattern = /aa\Z/m;
  1.1095 +string = 'b\nca\n';
  1.1096 +actualmatch = string.match(pattern);
  1.1097 +expectedmatch = null;
  1.1098 +addThis();
  1.1099 +
  1.1100 +status = inSection(149);
  1.1101 +pattern = /aa\z/m;
  1.1102 +string = 'b\nca\n';
  1.1103 +actualmatch = string.match(pattern);
  1.1104 +expectedmatch = null;
  1.1105 +addThis();
  1.1106 +
  1.1107 +status = inSection(150);
  1.1108 +pattern = /aa$/m;
  1.1109 +string = 'b\nca\n';
  1.1110 +actualmatch = string.match(pattern);
  1.1111 +expectedmatch = null;
  1.1112 +addThis();
  1.1113 +
  1.1114 +status = inSection(151);
  1.1115 +pattern = /aa\Z/m;
  1.1116 +string = 'b\nca';
  1.1117 +actualmatch = string.match(pattern);
  1.1118 +expectedmatch = null;
  1.1119 +addThis();
  1.1120 +
  1.1121 +status = inSection(152);
  1.1122 +pattern = /aa\z/m;
  1.1123 +string = 'b\nca';
  1.1124 +actualmatch = string.match(pattern);
  1.1125 +expectedmatch = null;
  1.1126 +addThis();
  1.1127 +
  1.1128 +status = inSection(153);
  1.1129 +pattern = /aa$/m;
  1.1130 +string = 'b\nca';
  1.1131 +actualmatch = string.match(pattern);
  1.1132 +expectedmatch = null;
  1.1133 +addThis();
  1.1134 +
  1.1135 +status = inSection(154);
  1.1136 +pattern = /ab\Z/;
  1.1137 +string = 'ab\nb\n';
  1.1138 +actualmatch = string.match(pattern);
  1.1139 +expectedmatch = null;
  1.1140 +addThis();
  1.1141 +
  1.1142 +status = inSection(155);
  1.1143 +pattern = /ab\z/;
  1.1144 +string = 'ab\nb\n';
  1.1145 +actualmatch = string.match(pattern);
  1.1146 +expectedmatch = null;
  1.1147 +addThis();
  1.1148 +
  1.1149 +status = inSection(156);
  1.1150 +pattern = /ab$/;
  1.1151 +string = 'ab\nb\n';
  1.1152 +actualmatch = string.match(pattern);
  1.1153 +expectedmatch = null;
  1.1154 +addThis();
  1.1155 +
  1.1156 +status = inSection(157);
  1.1157 +pattern = /ab\z/;
  1.1158 +string = 'b\nab\n';
  1.1159 +actualmatch = string.match(pattern);
  1.1160 +expectedmatch = null;
  1.1161 +addThis();
  1.1162 +
  1.1163 +status = inSection(158);
  1.1164 +pattern = /ab\z/m;
  1.1165 +string = 'ab\nb\n';
  1.1166 +actualmatch = string.match(pattern);
  1.1167 +expectedmatch = null;
  1.1168 +addThis();
  1.1169 +
  1.1170 +status = inSection(159);
  1.1171 +pattern = /ab\z/m;
  1.1172 +string = 'b\nab\n';
  1.1173 +actualmatch = string.match(pattern);
  1.1174 +expectedmatch = null;
  1.1175 +addThis();
  1.1176 +
  1.1177 +status = inSection(160);
  1.1178 +pattern = /ab\Z/;
  1.1179 +string = 'ac\nb\n';
  1.1180 +actualmatch = string.match(pattern);
  1.1181 +expectedmatch = null;
  1.1182 +addThis();
  1.1183 +
  1.1184 +status = inSection(161);
  1.1185 +pattern = /ab\z/;
  1.1186 +string = 'ac\nb\n';
  1.1187 +actualmatch = string.match(pattern);
  1.1188 +expectedmatch = null;
  1.1189 +addThis();
  1.1190 +
  1.1191 +status = inSection(162);
  1.1192 +pattern = /ab$/;
  1.1193 +string = 'ac\nb\n';
  1.1194 +actualmatch = string.match(pattern);
  1.1195 +expectedmatch = null;
  1.1196 +addThis();
  1.1197 +
  1.1198 +status = inSection(163);
  1.1199 +pattern = /ab\Z/;
  1.1200 +string = 'b\nac\n';
  1.1201 +actualmatch = string.match(pattern);
  1.1202 +expectedmatch = null;
  1.1203 +addThis();
  1.1204 +
  1.1205 +status = inSection(164);
  1.1206 +pattern = /ab\z/;
  1.1207 +string = 'b\nac\n';
  1.1208 +actualmatch = string.match(pattern);
  1.1209 +expectedmatch = null;
  1.1210 +addThis();
  1.1211 +
  1.1212 +status = inSection(165);
  1.1213 +pattern = /ab$/;
  1.1214 +string = 'b\nac\n';
  1.1215 +actualmatch = string.match(pattern);
  1.1216 +expectedmatch = null;
  1.1217 +addThis();
  1.1218 +
  1.1219 +status = inSection(166);
  1.1220 +pattern = /ab\Z/;
  1.1221 +string = 'b\nac';
  1.1222 +actualmatch = string.match(pattern);
  1.1223 +expectedmatch = null;
  1.1224 +addThis();
  1.1225 +
  1.1226 +status = inSection(167);
  1.1227 +pattern = /ab\z/;
  1.1228 +string = 'b\nac';
  1.1229 +actualmatch = string.match(pattern);
  1.1230 +expectedmatch = null;
  1.1231 +addThis();
  1.1232 +
  1.1233 +status = inSection(168);
  1.1234 +pattern = /ab$/;
  1.1235 +string = 'b\nac';
  1.1236 +actualmatch = string.match(pattern);
  1.1237 +expectedmatch = null;
  1.1238 +addThis();
  1.1239 +
  1.1240 +status = inSection(169);
  1.1241 +pattern = /ab\Z/m;
  1.1242 +string = 'ac\nb\n';
  1.1243 +actualmatch = string.match(pattern);
  1.1244 +expectedmatch = null;
  1.1245 +addThis();
  1.1246 +
  1.1247 +status = inSection(170);
  1.1248 +pattern = /ab\z/m;
  1.1249 +string = 'ac\nb\n';
  1.1250 +actualmatch = string.match(pattern);
  1.1251 +expectedmatch = null;
  1.1252 +addThis();
  1.1253 +
  1.1254 +status = inSection(171);
  1.1255 +pattern = /ab$/m;
  1.1256 +string = 'ac\nb\n';
  1.1257 +actualmatch = string.match(pattern);
  1.1258 +expectedmatch = null;
  1.1259 +addThis();
  1.1260 +
  1.1261 +status = inSection(172);
  1.1262 +pattern = /ab\Z/m;
  1.1263 +string = 'b\nac\n';
  1.1264 +actualmatch = string.match(pattern);
  1.1265 +expectedmatch = null;
  1.1266 +addThis();
  1.1267 +
  1.1268 +status = inSection(173);
  1.1269 +pattern = /ab\z/m;
  1.1270 +string = 'b\nac\n';
  1.1271 +actualmatch = string.match(pattern);
  1.1272 +expectedmatch = null;
  1.1273 +addThis();
  1.1274 +
  1.1275 +status = inSection(174);
  1.1276 +pattern = /ab$/m;
  1.1277 +string = 'b\nac\n';
  1.1278 +actualmatch = string.match(pattern);
  1.1279 +expectedmatch = null;
  1.1280 +addThis();
  1.1281 +
  1.1282 +status = inSection(175);
  1.1283 +pattern = /ab\Z/m;
  1.1284 +string = 'b\nac';
  1.1285 +actualmatch = string.match(pattern);
  1.1286 +expectedmatch = null;
  1.1287 +addThis();
  1.1288 +
  1.1289 +status = inSection(176);
  1.1290 +pattern = /ab\z/m;
  1.1291 +string = 'b\nac';
  1.1292 +actualmatch = string.match(pattern);
  1.1293 +expectedmatch = null;
  1.1294 +addThis();
  1.1295 +
  1.1296 +status = inSection(177);
  1.1297 +pattern = /ab$/m;
  1.1298 +string = 'b\nac';
  1.1299 +actualmatch = string.match(pattern);
  1.1300 +expectedmatch = null;
  1.1301 +addThis();
  1.1302 +
  1.1303 +status = inSection(178);
  1.1304 +pattern = /ab\Z/;
  1.1305 +string = 'ca\nb\n';
  1.1306 +actualmatch = string.match(pattern);
  1.1307 +expectedmatch = null;
  1.1308 +addThis();
  1.1309 +
  1.1310 +status = inSection(179);
  1.1311 +pattern = /ab\z/;
  1.1312 +string = 'ca\nb\n';
  1.1313 +actualmatch = string.match(pattern);
  1.1314 +expectedmatch = null;
  1.1315 +addThis();
  1.1316 +
  1.1317 +status = inSection(180);
  1.1318 +pattern = /ab$/;
  1.1319 +string = 'ca\nb\n';
  1.1320 +actualmatch = string.match(pattern);
  1.1321 +expectedmatch = null;
  1.1322 +addThis();
  1.1323 +
  1.1324 +status = inSection(181);
  1.1325 +pattern = /ab\Z/;
  1.1326 +string = 'b\nca\n';
  1.1327 +actualmatch = string.match(pattern);
  1.1328 +expectedmatch = null;
  1.1329 +addThis();
  1.1330 +
  1.1331 +status = inSection(182);
  1.1332 +pattern = /ab\z/;
  1.1333 +string = 'b\nca\n';
  1.1334 +actualmatch = string.match(pattern);
  1.1335 +expectedmatch = null;
  1.1336 +addThis();
  1.1337 +
  1.1338 +status = inSection(183);
  1.1339 +pattern = /ab$/;
  1.1340 +string = 'b\nca\n';
  1.1341 +actualmatch = string.match(pattern);
  1.1342 +expectedmatch = null;
  1.1343 +addThis();
  1.1344 +
  1.1345 +status = inSection(184);
  1.1346 +pattern = /ab\Z/;
  1.1347 +string = 'b\nca';
  1.1348 +actualmatch = string.match(pattern);
  1.1349 +expectedmatch = null;
  1.1350 +addThis();
  1.1351 +
  1.1352 +status = inSection(185);
  1.1353 +pattern = /ab\z/;
  1.1354 +string = 'b\nca';
  1.1355 +actualmatch = string.match(pattern);
  1.1356 +expectedmatch = null;
  1.1357 +addThis();
  1.1358 +
  1.1359 +status = inSection(186);
  1.1360 +pattern = /ab$/;
  1.1361 +string = 'b\nca';
  1.1362 +actualmatch = string.match(pattern);
  1.1363 +expectedmatch = null;
  1.1364 +addThis();
  1.1365 +
  1.1366 +status = inSection(187);
  1.1367 +pattern = /ab\Z/m;
  1.1368 +string = 'ca\nb\n';
  1.1369 +actualmatch = string.match(pattern);
  1.1370 +expectedmatch = null;
  1.1371 +addThis();
  1.1372 +
  1.1373 +status = inSection(188);
  1.1374 +pattern = /ab\z/m;
  1.1375 +string = 'ca\nb\n';
  1.1376 +actualmatch = string.match(pattern);
  1.1377 +expectedmatch = null;
  1.1378 +addThis();
  1.1379 +
  1.1380 +status = inSection(189);
  1.1381 +pattern = /ab$/m;
  1.1382 +string = 'ca\nb\n';
  1.1383 +actualmatch = string.match(pattern);
  1.1384 +expectedmatch = null;
  1.1385 +addThis();
  1.1386 +
  1.1387 +status = inSection(190);
  1.1388 +pattern = /ab\Z/m;
  1.1389 +string = 'b\nca\n';
  1.1390 +actualmatch = string.match(pattern);
  1.1391 +expectedmatch = null;
  1.1392 +addThis();
  1.1393 +
  1.1394 +status = inSection(191);
  1.1395 +pattern = /ab\z/m;
  1.1396 +string = 'b\nca\n';
  1.1397 +actualmatch = string.match(pattern);
  1.1398 +expectedmatch = null;
  1.1399 +addThis();
  1.1400 +
  1.1401 +status = inSection(192);
  1.1402 +pattern = /ab$/m;
  1.1403 +string = 'b\nca\n';
  1.1404 +actualmatch = string.match(pattern);
  1.1405 +expectedmatch = null;
  1.1406 +addThis();
  1.1407 +
  1.1408 +status = inSection(193);
  1.1409 +pattern = /ab\Z/m;
  1.1410 +string = 'b\nca';
  1.1411 +actualmatch = string.match(pattern);
  1.1412 +expectedmatch = null;
  1.1413 +addThis();
  1.1414 +
  1.1415 +status = inSection(194);
  1.1416 +pattern = /ab\z/m;
  1.1417 +string = 'b\nca';
  1.1418 +actualmatch = string.match(pattern);
  1.1419 +expectedmatch = null;
  1.1420 +addThis();
  1.1421 +
  1.1422 +status = inSection(195);
  1.1423 +pattern = /ab$/m;
  1.1424 +string = 'b\nca';
  1.1425 +actualmatch = string.match(pattern);
  1.1426 +expectedmatch = null;
  1.1427 +addThis();
  1.1428 +
  1.1429 +status = inSection(196);
  1.1430 +pattern = /abb\Z/;
  1.1431 +string = 'abb\nb\n';
  1.1432 +actualmatch = string.match(pattern);
  1.1433 +expectedmatch = null;
  1.1434 +addThis();
  1.1435 +
  1.1436 +status = inSection(197);
  1.1437 +pattern = /abb\z/;
  1.1438 +string = 'abb\nb\n';
  1.1439 +actualmatch = string.match(pattern);
  1.1440 +expectedmatch = null;
  1.1441 +addThis();
  1.1442 +
  1.1443 +status = inSection(198);
  1.1444 +pattern = /abb$/;
  1.1445 +string = 'abb\nb\n';
  1.1446 +actualmatch = string.match(pattern);
  1.1447 +expectedmatch = null;
  1.1448 +addThis();
  1.1449 +
  1.1450 +status = inSection(199);
  1.1451 +pattern = /abb\z/;
  1.1452 +string = 'b\nabb\n';
  1.1453 +actualmatch = string.match(pattern);
  1.1454 +expectedmatch = null;
  1.1455 +addThis();
  1.1456 +
  1.1457 +status = inSection(200);
  1.1458 +pattern = /abb\z/m;
  1.1459 +string = 'abb\nb\n';
  1.1460 +actualmatch = string.match(pattern);
  1.1461 +expectedmatch = null;
  1.1462 +addThis();
  1.1463 +
  1.1464 +status = inSection(201);
  1.1465 +pattern = /abb\z/m;
  1.1466 +string = 'b\nabb\n';
  1.1467 +actualmatch = string.match(pattern);
  1.1468 +expectedmatch = null;
  1.1469 +addThis();
  1.1470 +
  1.1471 +status = inSection(202);
  1.1472 +pattern = /abb\Z/;
  1.1473 +string = 'ac\nb\n';
  1.1474 +actualmatch = string.match(pattern);
  1.1475 +expectedmatch = null;
  1.1476 +addThis();
  1.1477 +
  1.1478 +status = inSection(203);
  1.1479 +pattern = /abb\z/;
  1.1480 +string = 'ac\nb\n';
  1.1481 +actualmatch = string.match(pattern);
  1.1482 +expectedmatch = null;
  1.1483 +addThis();
  1.1484 +
  1.1485 +status = inSection(204);
  1.1486 +pattern = /abb$/;
  1.1487 +string = 'ac\nb\n';
  1.1488 +actualmatch = string.match(pattern);
  1.1489 +expectedmatch = null;
  1.1490 +addThis();
  1.1491 +
  1.1492 +status = inSection(205);
  1.1493 +pattern = /abb\Z/;
  1.1494 +string = 'b\nac\n';
  1.1495 +actualmatch = string.match(pattern);
  1.1496 +expectedmatch = null;
  1.1497 +addThis();
  1.1498 +
  1.1499 +status = inSection(206);
  1.1500 +pattern = /abb\z/;
  1.1501 +string = 'b\nac\n';
  1.1502 +actualmatch = string.match(pattern);
  1.1503 +expectedmatch = null;
  1.1504 +addThis();
  1.1505 +
  1.1506 +status = inSection(207);
  1.1507 +pattern = /abb$/;
  1.1508 +string = 'b\nac\n';
  1.1509 +actualmatch = string.match(pattern);
  1.1510 +expectedmatch = null;
  1.1511 +addThis();
  1.1512 +
  1.1513 +status = inSection(208);
  1.1514 +pattern = /abb\Z/;
  1.1515 +string = 'b\nac';
  1.1516 +actualmatch = string.match(pattern);
  1.1517 +expectedmatch = null;
  1.1518 +addThis();
  1.1519 +
  1.1520 +status = inSection(209);
  1.1521 +pattern = /abb\z/;
  1.1522 +string = 'b\nac';
  1.1523 +actualmatch = string.match(pattern);
  1.1524 +expectedmatch = null;
  1.1525 +addThis();
  1.1526 +
  1.1527 +status = inSection(210);
  1.1528 +pattern = /abb$/;
  1.1529 +string = 'b\nac';
  1.1530 +actualmatch = string.match(pattern);
  1.1531 +expectedmatch = null;
  1.1532 +addThis();
  1.1533 +
  1.1534 +status = inSection(211);
  1.1535 +pattern = /abb\Z/m;
  1.1536 +string = 'ac\nb\n';
  1.1537 +actualmatch = string.match(pattern);
  1.1538 +expectedmatch = null;
  1.1539 +addThis();
  1.1540 +
  1.1541 +status = inSection(212);
  1.1542 +pattern = /abb\z/m;
  1.1543 +string = 'ac\nb\n';
  1.1544 +actualmatch = string.match(pattern);
  1.1545 +expectedmatch = null;
  1.1546 +addThis();
  1.1547 +
  1.1548 +status = inSection(213);
  1.1549 +pattern = /abb$/m;
  1.1550 +string = 'ac\nb\n';
  1.1551 +actualmatch = string.match(pattern);
  1.1552 +expectedmatch = null;
  1.1553 +addThis();
  1.1554 +
  1.1555 +status = inSection(214);
  1.1556 +pattern = /abb\Z/m;
  1.1557 +string = 'b\nac\n';
  1.1558 +actualmatch = string.match(pattern);
  1.1559 +expectedmatch = null;
  1.1560 +addThis();
  1.1561 +
  1.1562 +status = inSection(215);
  1.1563 +pattern = /abb\z/m;
  1.1564 +string = 'b\nac\n';
  1.1565 +actualmatch = string.match(pattern);
  1.1566 +expectedmatch = null;
  1.1567 +addThis();
  1.1568 +
  1.1569 +status = inSection(216);
  1.1570 +pattern = /abb$/m;
  1.1571 +string = 'b\nac\n';
  1.1572 +actualmatch = string.match(pattern);
  1.1573 +expectedmatch = null;
  1.1574 +addThis();
  1.1575 +
  1.1576 +status = inSection(217);
  1.1577 +pattern = /abb\Z/m;
  1.1578 +string = 'b\nac';
  1.1579 +actualmatch = string.match(pattern);
  1.1580 +expectedmatch = null;
  1.1581 +addThis();
  1.1582 +
  1.1583 +status = inSection(218);
  1.1584 +pattern = /abb\z/m;
  1.1585 +string = 'b\nac';
  1.1586 +actualmatch = string.match(pattern);
  1.1587 +expectedmatch = null;
  1.1588 +addThis();
  1.1589 +
  1.1590 +status = inSection(219);
  1.1591 +pattern = /abb$/m;
  1.1592 +string = 'b\nac';
  1.1593 +actualmatch = string.match(pattern);
  1.1594 +expectedmatch = null;
  1.1595 +addThis();
  1.1596 +
  1.1597 +status = inSection(220);
  1.1598 +pattern = /abb\Z/;
  1.1599 +string = 'ca\nb\n';
  1.1600 +actualmatch = string.match(pattern);
  1.1601 +expectedmatch = null;
  1.1602 +addThis();
  1.1603 +
  1.1604 +status = inSection(221);
  1.1605 +pattern = /abb\z/;
  1.1606 +string = 'ca\nb\n';
  1.1607 +actualmatch = string.match(pattern);
  1.1608 +expectedmatch = null;
  1.1609 +addThis();
  1.1610 +
  1.1611 +status = inSection(222);
  1.1612 +pattern = /abb$/;
  1.1613 +string = 'ca\nb\n';
  1.1614 +actualmatch = string.match(pattern);
  1.1615 +expectedmatch = null;
  1.1616 +addThis();
  1.1617 +
  1.1618 +status = inSection(223);
  1.1619 +pattern = /abb\Z/;
  1.1620 +string = 'b\nca\n';
  1.1621 +actualmatch = string.match(pattern);
  1.1622 +expectedmatch = null;
  1.1623 +addThis();
  1.1624 +
  1.1625 +status = inSection(224);
  1.1626 +pattern = /abb\z/;
  1.1627 +string = 'b\nca\n';
  1.1628 +actualmatch = string.match(pattern);
  1.1629 +expectedmatch = null;
  1.1630 +addThis();
  1.1631 +
  1.1632 +status = inSection(225);
  1.1633 +pattern = /abb$/;
  1.1634 +string = 'b\nca\n';
  1.1635 +actualmatch = string.match(pattern);
  1.1636 +expectedmatch = null;
  1.1637 +addThis();
  1.1638 +
  1.1639 +status = inSection(226);
  1.1640 +pattern = /abb\Z/;
  1.1641 +string = 'b\nca';
  1.1642 +actualmatch = string.match(pattern);
  1.1643 +expectedmatch = null;
  1.1644 +addThis();
  1.1645 +
  1.1646 +status = inSection(227);
  1.1647 +pattern = /abb\z/;
  1.1648 +string = 'b\nca';
  1.1649 +actualmatch = string.match(pattern);
  1.1650 +expectedmatch = null;
  1.1651 +addThis();
  1.1652 +
  1.1653 +status = inSection(228);
  1.1654 +pattern = /abb$/;
  1.1655 +string = 'b\nca';
  1.1656 +actualmatch = string.match(pattern);
  1.1657 +expectedmatch = null;
  1.1658 +addThis();
  1.1659 +
  1.1660 +status = inSection(229);
  1.1661 +pattern = /abb\Z/m;
  1.1662 +string = 'ca\nb\n';
  1.1663 +actualmatch = string.match(pattern);
  1.1664 +expectedmatch = null;
  1.1665 +addThis();
  1.1666 +
  1.1667 +status = inSection(230);
  1.1668 +pattern = /abb\z/m;
  1.1669 +string = 'ca\nb\n';
  1.1670 +actualmatch = string.match(pattern);
  1.1671 +expectedmatch = null;
  1.1672 +addThis();
  1.1673 +
  1.1674 +status = inSection(231);
  1.1675 +pattern = /abb$/m;
  1.1676 +string = 'ca\nb\n';
  1.1677 +actualmatch = string.match(pattern);
  1.1678 +expectedmatch = null;
  1.1679 +addThis();
  1.1680 +
  1.1681 +status = inSection(232);
  1.1682 +pattern = /abb\Z/m;
  1.1683 +string = 'b\nca\n';
  1.1684 +actualmatch = string.match(pattern);
  1.1685 +expectedmatch = null;
  1.1686 +addThis();
  1.1687 +
  1.1688 +status = inSection(233);
  1.1689 +pattern = /abb\z/m;
  1.1690 +string = 'b\nca\n';
  1.1691 +actualmatch = string.match(pattern);
  1.1692 +expectedmatch = null;
  1.1693 +addThis();
  1.1694 +
  1.1695 +status = inSection(234);
  1.1696 +pattern = /abb$/m;
  1.1697 +string = 'b\nca\n';
  1.1698 +actualmatch = string.match(pattern);
  1.1699 +expectedmatch = null;
  1.1700 +addThis();
  1.1701 +
  1.1702 +status = inSection(235);
  1.1703 +pattern = /abb\Z/m;
  1.1704 +string = 'b\nca';
  1.1705 +actualmatch = string.match(pattern);
  1.1706 +expectedmatch = null;
  1.1707 +addThis();
  1.1708 +
  1.1709 +status = inSection(236);
  1.1710 +pattern = /abb\z/m;
  1.1711 +string = 'b\nca';
  1.1712 +actualmatch = string.match(pattern);
  1.1713 +expectedmatch = null;
  1.1714 +addThis();
  1.1715 +
  1.1716 +status = inSection(237);
  1.1717 +pattern = /abb$/m;
  1.1718 +string = 'b\nca';
  1.1719 +actualmatch = string.match(pattern);
  1.1720 +expectedmatch = null;
  1.1721 +addThis();
  1.1722 +
  1.1723 +status = inSection(238);
  1.1724 +pattern = /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/;
  1.1725 +string = 'x';
  1.1726 +actualmatch = string.match(pattern);
  1.1727 +expectedmatch = null;
  1.1728 +addThis();
  1.1729 +
  1.1730 +status = inSection(239);
  1.1731 +pattern = /\GX.*X/;
  1.1732 +string = 'aaaXbX';
  1.1733 +actualmatch = string.match(pattern);
  1.1734 +expectedmatch = null;
  1.1735 +addThis();
  1.1736 +
  1.1737 +status = inSection(240);
  1.1738 +pattern = /\.c(pp|xx|c)?$/i;
  1.1739 +string = 'Changes';
  1.1740 +actualmatch = string.match(pattern);
  1.1741 +expectedmatch = null;
  1.1742 +addThis();
  1.1743 +
  1.1744 +status = inSection(241);
  1.1745 +pattern = /^([a-z]:)/;
  1.1746 +string = 'C:/';
  1.1747 +actualmatch = string.match(pattern);
  1.1748 +expectedmatch = null;
  1.1749 +addThis();
  1.1750 +
  1.1751 +status = inSection(242);
  1.1752 +pattern = /(\w)?(abc)\1b/;
  1.1753 +string = 'abcab';
  1.1754 +actualmatch = string.match(pattern);
  1.1755 +expectedmatch = null;
  1.1756 +addThis();
  1.1757 +
  1.1758 +/* ECMA doesn't support (?(
  1.1759 +   status = inSection(243);
  1.1760 +   pattern = /^(a)?(?(1)a|b)+$/;
  1.1761 +   string = 'a';
  1.1762 +   actualmatch = string.match(pattern);
  1.1763 +   expectedmatch = null;
  1.1764 +   addThis();
  1.1765 +*/
  1.1766 +
  1.1767 +
  1.1768 +
  1.1769 +//-----------------------------------------------------------------------------
  1.1770 +test();
  1.1771 +//-----------------------------------------------------------------------------
  1.1772 +
  1.1773 +
  1.1774 +
  1.1775 +function addThis()
  1.1776 +{
  1.1777 +  if(omitCurrentSection())
  1.1778 +    return;
  1.1779 +
  1.1780 +  statusmessages[i] = status;
  1.1781 +  patterns[i] = pattern;
  1.1782 +  strings[i] = string;
  1.1783 +  actualmatches[i] = actualmatch;
  1.1784 +  expectedmatches[i] = expectedmatch;
  1.1785 +  i++;
  1.1786 +}
  1.1787 +
  1.1788 +
  1.1789 +function omitCurrentSection()
  1.1790 +{
  1.1791 +  try
  1.1792 +  {
  1.1793 +    // current section number is in global status variable
  1.1794 +    var n = status.match(/(\d+)/)[1];
  1.1795 +    return ((n < cnLBOUND) || (n > cnUBOUND));
  1.1796 +  }
  1.1797 +  catch(e)
  1.1798 +  {
  1.1799 +    return false;
  1.1800 +  }
  1.1801 +}
  1.1802 +
  1.1803 +
  1.1804 +function test()
  1.1805 +{
  1.1806 +  enterFunc ('test');
  1.1807 +  printBugNumber(BUGNUMBER);
  1.1808 +  printStatus (summary);
  1.1809 +  testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
  1.1810 +  exitFunc ('test');
  1.1811 +}

mercurial