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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /*
michael@0 7 *
michael@0 8 * Date: 2002-07-07
michael@0 9 * SUMMARY: Testing JS RegExp engine against Perl 5 RegExp engine.
michael@0 10 * Adjust cnLBOUND, cnUBOUND below to restrict which sections are tested.
michael@0 11 *
michael@0 12 * This test was created by running various patterns and strings through the
michael@0 13 * Perl 5 RegExp engine. We saved the results below to test the JS engine.
michael@0 14 *
michael@0 15 * Each of the examples below is a negative test; that is, each produces a
michael@0 16 * null match in Perl. Thus we set |expectedmatch| = |null| in each section.
michael@0 17 *
michael@0 18 * NOTE: ECMA/JS and Perl do differ on certain points. We have either commented
michael@0 19 * out such sections altogether, or modified them to fit what we expect from JS.
michael@0 20 *
michael@0 21 * EXAMPLES:
michael@0 22 *
michael@0 23 * - ECMA does support (?: (?= and (?! operators, but doesn't support (?< etc.
michael@0 24 *
michael@0 25 * - ECMA doesn't support (?(condition)
michael@0 26 *
michael@0 27 */
michael@0 28 //-----------------------------------------------------------------------------
michael@0 29 var i = 0;
michael@0 30 var BUGNUMBER = 85721;
michael@0 31 var summary = 'Testing regular expression edge cases';
michael@0 32 var cnSingleSpace = ' ';
michael@0 33 var status = '';
michael@0 34 var statusmessages = new Array();
michael@0 35 var pattern = '';
michael@0 36 var patterns = new Array();
michael@0 37 var string = '';
michael@0 38 var strings = new Array();
michael@0 39 var actualmatch = '';
michael@0 40 var actualmatches = new Array();
michael@0 41 var expectedmatch = '';
michael@0 42 var expectedmatches = new Array();
michael@0 43 var cnLBOUND = 0;
michael@0 44 var cnUBOUND = 1000;
michael@0 45
michael@0 46
michael@0 47 status = inSection(1);
michael@0 48 pattern = /abc/;
michael@0 49 string = 'xbc';
michael@0 50 actualmatch = string.match(pattern);
michael@0 51 expectedmatch = null;
michael@0 52 addThis();
michael@0 53
michael@0 54 status = inSection(2);
michael@0 55 pattern = /abc/;
michael@0 56 string = 'axc';
michael@0 57 actualmatch = string.match(pattern);
michael@0 58 expectedmatch = null;
michael@0 59 addThis();
michael@0 60
michael@0 61 status = inSection(3);
michael@0 62 pattern = /abc/;
michael@0 63 string = 'abx';
michael@0 64 actualmatch = string.match(pattern);
michael@0 65 expectedmatch = null;
michael@0 66 addThis();
michael@0 67
michael@0 68 status = inSection(4);
michael@0 69 pattern = /ab+bc/;
michael@0 70 string = 'abc';
michael@0 71 actualmatch = string.match(pattern);
michael@0 72 expectedmatch = null;
michael@0 73 addThis();
michael@0 74
michael@0 75 status = inSection(5);
michael@0 76 pattern = /ab+bc/;
michael@0 77 string = 'abq';
michael@0 78 actualmatch = string.match(pattern);
michael@0 79 expectedmatch = null;
michael@0 80 addThis();
michael@0 81
michael@0 82 status = inSection(6);
michael@0 83 pattern = /ab{1,}bc/;
michael@0 84 string = 'abq';
michael@0 85 actualmatch = string.match(pattern);
michael@0 86 expectedmatch = null;
michael@0 87 addThis();
michael@0 88
michael@0 89 status = inSection(7);
michael@0 90 pattern = /ab{4,5}bc/;
michael@0 91 string = 'abbbbc';
michael@0 92 actualmatch = string.match(pattern);
michael@0 93 expectedmatch = null;
michael@0 94 addThis();
michael@0 95
michael@0 96 status = inSection(8);
michael@0 97 pattern = /ab?bc/;
michael@0 98 string = 'abbbbc';
michael@0 99 actualmatch = string.match(pattern);
michael@0 100 expectedmatch = null;
michael@0 101 addThis();
michael@0 102
michael@0 103 status = inSection(9);
michael@0 104 pattern = /^abc$/;
michael@0 105 string = 'abcc';
michael@0 106 actualmatch = string.match(pattern);
michael@0 107 expectedmatch = null;
michael@0 108 addThis();
michael@0 109
michael@0 110 status = inSection(10);
michael@0 111 pattern = /^abc$/;
michael@0 112 string = 'aabc';
michael@0 113 actualmatch = string.match(pattern);
michael@0 114 expectedmatch = null;
michael@0 115 addThis();
michael@0 116
michael@0 117 status = inSection(11);
michael@0 118 pattern = /abc$/;
michael@0 119 string = 'aabcd';
michael@0 120 actualmatch = string.match(pattern);
michael@0 121 expectedmatch = null;
michael@0 122 addThis();
michael@0 123
michael@0 124 status = inSection(12);
michael@0 125 pattern = /a.*c/;
michael@0 126 string = 'axyzd';
michael@0 127 actualmatch = string.match(pattern);
michael@0 128 expectedmatch = null;
michael@0 129 addThis();
michael@0 130
michael@0 131 status = inSection(13);
michael@0 132 pattern = /a[bc]d/;
michael@0 133 string = 'abc';
michael@0 134 actualmatch = string.match(pattern);
michael@0 135 expectedmatch = null;
michael@0 136 addThis();
michael@0 137
michael@0 138 status = inSection(14);
michael@0 139 pattern = /a[b-d]e/;
michael@0 140 string = 'abd';
michael@0 141 actualmatch = string.match(pattern);
michael@0 142 expectedmatch = null;
michael@0 143 addThis();
michael@0 144
michael@0 145 status = inSection(15);
michael@0 146 pattern = /a[^bc]d/;
michael@0 147 string = 'abd';
michael@0 148 actualmatch = string.match(pattern);
michael@0 149 expectedmatch = null;
michael@0 150 addThis();
michael@0 151
michael@0 152 status = inSection(16);
michael@0 153 pattern = /a[^-b]c/;
michael@0 154 string = 'a-c';
michael@0 155 actualmatch = string.match(pattern);
michael@0 156 expectedmatch = null;
michael@0 157 addThis();
michael@0 158
michael@0 159 status = inSection(17);
michael@0 160 pattern = /a[^]b]c/;
michael@0 161 string = 'a]c';
michael@0 162 actualmatch = string.match(pattern);
michael@0 163 expectedmatch = null;
michael@0 164 addThis();
michael@0 165
michael@0 166 status = inSection(18);
michael@0 167 pattern = /\by\b/;
michael@0 168 string = 'xy';
michael@0 169 actualmatch = string.match(pattern);
michael@0 170 expectedmatch = null;
michael@0 171 addThis();
michael@0 172
michael@0 173 status = inSection(19);
michael@0 174 pattern = /\by\b/;
michael@0 175 string = 'yz';
michael@0 176 actualmatch = string.match(pattern);
michael@0 177 expectedmatch = null;
michael@0 178 addThis();
michael@0 179
michael@0 180 status = inSection(20);
michael@0 181 pattern = /\by\b/;
michael@0 182 string = 'xyz';
michael@0 183 actualmatch = string.match(pattern);
michael@0 184 expectedmatch = null;
michael@0 185 addThis();
michael@0 186
michael@0 187 status = inSection(21);
michael@0 188 pattern = /\Ba\B/;
michael@0 189 string = 'a-';
michael@0 190 actualmatch = string.match(pattern);
michael@0 191 expectedmatch = null;
michael@0 192 addThis();
michael@0 193
michael@0 194 status = inSection(22);
michael@0 195 pattern = /\Ba\B/;
michael@0 196 string = '-a';
michael@0 197 actualmatch = string.match(pattern);
michael@0 198 expectedmatch = null;
michael@0 199 addThis();
michael@0 200
michael@0 201 status = inSection(23);
michael@0 202 pattern = /\Ba\B/;
michael@0 203 string = '-a-';
michael@0 204 actualmatch = string.match(pattern);
michael@0 205 expectedmatch = null;
michael@0 206 addThis();
michael@0 207
michael@0 208 status = inSection(24);
michael@0 209 pattern = /\w/;
michael@0 210 string = '-';
michael@0 211 actualmatch = string.match(pattern);
michael@0 212 expectedmatch = null;
michael@0 213 addThis();
michael@0 214
michael@0 215 status = inSection(25);
michael@0 216 pattern = /\W/;
michael@0 217 string = 'a';
michael@0 218 actualmatch = string.match(pattern);
michael@0 219 expectedmatch = null;
michael@0 220 addThis();
michael@0 221
michael@0 222 status = inSection(26);
michael@0 223 pattern = /a\sb/;
michael@0 224 string = 'a-b';
michael@0 225 actualmatch = string.match(pattern);
michael@0 226 expectedmatch = null;
michael@0 227 addThis();
michael@0 228
michael@0 229 status = inSection(27);
michael@0 230 pattern = /\d/;
michael@0 231 string = '-';
michael@0 232 actualmatch = string.match(pattern);
michael@0 233 expectedmatch = null;
michael@0 234 addThis();
michael@0 235
michael@0 236 status = inSection(28);
michael@0 237 pattern = /\D/;
michael@0 238 string = '1';
michael@0 239 actualmatch = string.match(pattern);
michael@0 240 expectedmatch = null;
michael@0 241 addThis();
michael@0 242
michael@0 243 status = inSection(29);
michael@0 244 pattern = /[\w]/;
michael@0 245 string = '-';
michael@0 246 actualmatch = string.match(pattern);
michael@0 247 expectedmatch = null;
michael@0 248 addThis();
michael@0 249
michael@0 250 status = inSection(30);
michael@0 251 pattern = /[\W]/;
michael@0 252 string = 'a';
michael@0 253 actualmatch = string.match(pattern);
michael@0 254 expectedmatch = null;
michael@0 255 addThis();
michael@0 256
michael@0 257 status = inSection(31);
michael@0 258 pattern = /a[\s]b/;
michael@0 259 string = 'a-b';
michael@0 260 actualmatch = string.match(pattern);
michael@0 261 expectedmatch = null;
michael@0 262 addThis();
michael@0 263
michael@0 264 status = inSection(32);
michael@0 265 pattern = /[\d]/;
michael@0 266 string = '-';
michael@0 267 actualmatch = string.match(pattern);
michael@0 268 expectedmatch = null;
michael@0 269 addThis();
michael@0 270
michael@0 271 status = inSection(33);
michael@0 272 pattern = /[\D]/;
michael@0 273 string = '1';
michael@0 274 actualmatch = string.match(pattern);
michael@0 275 expectedmatch = null;
michael@0 276 addThis();
michael@0 277
michael@0 278 status = inSection(34);
michael@0 279 pattern = /$b/;
michael@0 280 string = 'b';
michael@0 281 actualmatch = string.match(pattern);
michael@0 282 expectedmatch = null;
michael@0 283 addThis();
michael@0 284
michael@0 285 status = inSection(35);
michael@0 286 pattern = /^(ab|cd)e/;
michael@0 287 string = 'abcde';
michael@0 288 actualmatch = string.match(pattern);
michael@0 289 expectedmatch = null;
michael@0 290 addThis();
michael@0 291
michael@0 292 status = inSection(36);
michael@0 293 pattern = /a[bcd]+dcdcde/;
michael@0 294 string = 'adcdcde';
michael@0 295 actualmatch = string.match(pattern);
michael@0 296 expectedmatch = null;
michael@0 297 addThis();
michael@0 298
michael@0 299 status = inSection(37);
michael@0 300 pattern = /(bc+d$|ef*g.|h?i(j|k))/;
michael@0 301 string = 'effg';
michael@0 302 actualmatch = string.match(pattern);
michael@0 303 expectedmatch = null;
michael@0 304 addThis();
michael@0 305
michael@0 306 status = inSection(38);
michael@0 307 pattern = /(bc+d$|ef*g.|h?i(j|k))/;
michael@0 308 string = 'bcdd';
michael@0 309 actualmatch = string.match(pattern);
michael@0 310 expectedmatch = null;
michael@0 311 addThis();
michael@0 312
michael@0 313 status = inSection(39);
michael@0 314 pattern = /[k]/;
michael@0 315 string = 'ab';
michael@0 316 actualmatch = string.match(pattern);
michael@0 317 expectedmatch = null;
michael@0 318 addThis();
michael@0 319
michael@0 320 // MODIFIED - ECMA has different rules for paren contents.
michael@0 321 status = inSection(40);
michael@0 322 pattern = /(a)|\1/;
michael@0 323 string = 'x';
michael@0 324 actualmatch = string.match(pattern);
michael@0 325 //expectedmatch = null;
michael@0 326 expectedmatch = Array("", undefined);
michael@0 327 addThis();
michael@0 328
michael@0 329 // MODIFIED - ECMA has different rules for paren contents.
michael@0 330 status = inSection(41);
michael@0 331 pattern = /((\3|b)\2(a)x)+/;
michael@0 332 string = 'aaxabxbaxbbx';
michael@0 333 actualmatch = string.match(pattern);
michael@0 334 //expectedmatch = null;
michael@0 335 expectedmatch = Array("ax", "ax", "", "a");
michael@0 336 addThis();
michael@0 337
michael@0 338 status = inSection(42);
michael@0 339 pattern = /abc/i;
michael@0 340 string = 'XBC';
michael@0 341 actualmatch = string.match(pattern);
michael@0 342 expectedmatch = null;
michael@0 343 addThis();
michael@0 344
michael@0 345 status = inSection(43);
michael@0 346 pattern = /abc/i;
michael@0 347 string = 'AXC';
michael@0 348 actualmatch = string.match(pattern);
michael@0 349 expectedmatch = null;
michael@0 350 addThis();
michael@0 351
michael@0 352 status = inSection(44);
michael@0 353 pattern = /abc/i;
michael@0 354 string = 'ABX';
michael@0 355 actualmatch = string.match(pattern);
michael@0 356 expectedmatch = null;
michael@0 357 addThis();
michael@0 358
michael@0 359 status = inSection(45);
michael@0 360 pattern = /ab+bc/i;
michael@0 361 string = 'ABC';
michael@0 362 actualmatch = string.match(pattern);
michael@0 363 expectedmatch = null;
michael@0 364 addThis();
michael@0 365
michael@0 366 status = inSection(46);
michael@0 367 pattern = /ab+bc/i;
michael@0 368 string = 'ABQ';
michael@0 369 actualmatch = string.match(pattern);
michael@0 370 expectedmatch = null;
michael@0 371 addThis();
michael@0 372
michael@0 373 status = inSection(47);
michael@0 374 pattern = /ab{1,}bc/i;
michael@0 375 string = 'ABQ';
michael@0 376 actualmatch = string.match(pattern);
michael@0 377 expectedmatch = null;
michael@0 378 addThis();
michael@0 379
michael@0 380 status = inSection(48);
michael@0 381 pattern = /ab{4,5}?bc/i;
michael@0 382 string = 'ABBBBC';
michael@0 383 actualmatch = string.match(pattern);
michael@0 384 expectedmatch = null;
michael@0 385 addThis();
michael@0 386
michael@0 387 status = inSection(49);
michael@0 388 pattern = /ab??bc/i;
michael@0 389 string = 'ABBBBC';
michael@0 390 actualmatch = string.match(pattern);
michael@0 391 expectedmatch = null;
michael@0 392 addThis();
michael@0 393
michael@0 394 status = inSection(50);
michael@0 395 pattern = /^abc$/i;
michael@0 396 string = 'ABCC';
michael@0 397 actualmatch = string.match(pattern);
michael@0 398 expectedmatch = null;
michael@0 399 addThis();
michael@0 400
michael@0 401 status = inSection(51);
michael@0 402 pattern = /^abc$/i;
michael@0 403 string = 'AABC';
michael@0 404 actualmatch = string.match(pattern);
michael@0 405 expectedmatch = null;
michael@0 406 addThis();
michael@0 407
michael@0 408 status = inSection(52);
michael@0 409 pattern = /a.*c/i;
michael@0 410 string = 'AXYZD';
michael@0 411 actualmatch = string.match(pattern);
michael@0 412 expectedmatch = null;
michael@0 413 addThis();
michael@0 414
michael@0 415 status = inSection(53);
michael@0 416 pattern = /a[bc]d/i;
michael@0 417 string = 'ABC';
michael@0 418 actualmatch = string.match(pattern);
michael@0 419 expectedmatch = null;
michael@0 420 addThis();
michael@0 421
michael@0 422 status = inSection(54);
michael@0 423 pattern = /a[b-d]e/i;
michael@0 424 string = 'ABD';
michael@0 425 actualmatch = string.match(pattern);
michael@0 426 expectedmatch = null;
michael@0 427 addThis();
michael@0 428
michael@0 429 status = inSection(55);
michael@0 430 pattern = /a[^bc]d/i;
michael@0 431 string = 'ABD';
michael@0 432 actualmatch = string.match(pattern);
michael@0 433 expectedmatch = null;
michael@0 434 addThis();
michael@0 435
michael@0 436 status = inSection(56);
michael@0 437 pattern = /a[^-b]c/i;
michael@0 438 string = 'A-C';
michael@0 439 actualmatch = string.match(pattern);
michael@0 440 expectedmatch = null;
michael@0 441 addThis();
michael@0 442
michael@0 443 status = inSection(57);
michael@0 444 pattern = /a[^]b]c/i;
michael@0 445 string = 'A]C';
michael@0 446 actualmatch = string.match(pattern);
michael@0 447 expectedmatch = null;
michael@0 448 addThis();
michael@0 449
michael@0 450 status = inSection(58);
michael@0 451 pattern = /$b/i;
michael@0 452 string = 'B';
michael@0 453 actualmatch = string.match(pattern);
michael@0 454 expectedmatch = null;
michael@0 455 addThis();
michael@0 456
michael@0 457 status = inSection(59);
michael@0 458 pattern = /^(ab|cd)e/i;
michael@0 459 string = 'ABCDE';
michael@0 460 actualmatch = string.match(pattern);
michael@0 461 expectedmatch = null;
michael@0 462 addThis();
michael@0 463
michael@0 464 status = inSection(60);
michael@0 465 pattern = /a[bcd]+dcdcde/i;
michael@0 466 string = 'ADCDCDE';
michael@0 467 actualmatch = string.match(pattern);
michael@0 468 expectedmatch = null;
michael@0 469 addThis();
michael@0 470
michael@0 471 status = inSection(61);
michael@0 472 pattern = /(bc+d$|ef*g.|h?i(j|k))/i;
michael@0 473 string = 'EFFG';
michael@0 474 actualmatch = string.match(pattern);
michael@0 475 expectedmatch = null;
michael@0 476 addThis();
michael@0 477
michael@0 478 status = inSection(62);
michael@0 479 pattern = /(bc+d$|ef*g.|h?i(j|k))/i;
michael@0 480 string = 'BCDD';
michael@0 481 actualmatch = string.match(pattern);
michael@0 482 expectedmatch = null;
michael@0 483 addThis();
michael@0 484
michael@0 485 status = inSection(63);
michael@0 486 pattern = /[k]/i;
michael@0 487 string = 'AB';
michael@0 488 actualmatch = string.match(pattern);
michael@0 489 expectedmatch = null;
michael@0 490 addThis();
michael@0 491
michael@0 492 status = inSection(64);
michael@0 493 pattern = /^(a\1?){4}$/;
michael@0 494 string = 'aaaaaaaaa';
michael@0 495 actualmatch = string.match(pattern);
michael@0 496 expectedmatch = null;
michael@0 497 addThis();
michael@0 498
michael@0 499 status = inSection(65);
michael@0 500 pattern = /^(a\1?){4}$/;
michael@0 501 string = 'aaaaaaaaaaa';
michael@0 502 actualmatch = string.match(pattern);
michael@0 503 expectedmatch = null;
michael@0 504 addThis();
michael@0 505
michael@0 506 /* ECMA doesn't support (?(
michael@0 507 status = inSection(66);
michael@0 508 pattern = /^(a(?(1)\1)){4}$/;
michael@0 509 string = 'aaaaaaaaa';
michael@0 510 actualmatch = string.match(pattern);
michael@0 511 expectedmatch = null;
michael@0 512 addThis();
michael@0 513
michael@0 514 status = inSection(67);
michael@0 515 pattern = /^(a(?(1)\1)){4}$/;
michael@0 516 string = 'aaaaaaaaaaa';
michael@0 517 actualmatch = string.match(pattern);
michael@0 518 expectedmatch = null;
michael@0 519 addThis();
michael@0 520 */
michael@0 521
michael@0 522 /* ECMA doesn't support (?<
michael@0 523 status = inSection(68);
michael@0 524 pattern = /(?<=a)b/;
michael@0 525 string = 'cb';
michael@0 526 actualmatch = string.match(pattern);
michael@0 527 expectedmatch = null;
michael@0 528 addThis();
michael@0 529
michael@0 530 status = inSection(69);
michael@0 531 pattern = /(?<=a)b/;
michael@0 532 string = 'b';
michael@0 533 actualmatch = string.match(pattern);
michael@0 534 expectedmatch = null;
michael@0 535 addThis();
michael@0 536
michael@0 537 status = inSection(70);
michael@0 538 pattern = /(?<!c)b/;
michael@0 539 string = 'cb';
michael@0 540 actualmatch = string.match(pattern);
michael@0 541 expectedmatch = null;
michael@0 542 addThis();
michael@0 543 */
michael@0 544
michael@0 545 /* ECMA doesn't support (?(condition)
michael@0 546 status = inSection(71);
michael@0 547 pattern = /(?:(?i)a)b/;
michael@0 548 string = 'aB';
michael@0 549 actualmatch = string.match(pattern);
michael@0 550 expectedmatch = null;
michael@0 551 addThis();
michael@0 552
michael@0 553 status = inSection(72);
michael@0 554 pattern = /((?i)a)b/;
michael@0 555 string = 'aB';
michael@0 556 actualmatch = string.match(pattern);
michael@0 557 expectedmatch = null;
michael@0 558 addThis();
michael@0 559
michael@0 560 status = inSection(73);
michael@0 561 pattern = /(?i:a)b/;
michael@0 562 string = 'aB';
michael@0 563 actualmatch = string.match(pattern);
michael@0 564 expectedmatch = null;
michael@0 565 addThis();
michael@0 566
michael@0 567 status = inSection(74);
michael@0 568 pattern = /((?i:a))b/;
michael@0 569 string = 'aB';
michael@0 570 actualmatch = string.match(pattern);
michael@0 571 expectedmatch = null;
michael@0 572 addThis();
michael@0 573
michael@0 574 status = inSection(75);
michael@0 575 pattern = /(?:(?-i)a)b/i;
michael@0 576 string = 'Ab';
michael@0 577 actualmatch = string.match(pattern);
michael@0 578 expectedmatch = null;
michael@0 579 addThis();
michael@0 580
michael@0 581 status = inSection(76);
michael@0 582 pattern = /((?-i)a)b/i;
michael@0 583 string = 'Ab';
michael@0 584 actualmatch = string.match(pattern);
michael@0 585 expectedmatch = null;
michael@0 586 addThis();
michael@0 587
michael@0 588 status = inSection(77);
michael@0 589 pattern = /(?:(?-i)a)b/i;
michael@0 590 string = 'AB';
michael@0 591 actualmatch = string.match(pattern);
michael@0 592 expectedmatch = null;
michael@0 593 addThis();
michael@0 594
michael@0 595 status = inSection(78);
michael@0 596 pattern = /((?-i)a)b/i;
michael@0 597 string = 'AB';
michael@0 598 actualmatch = string.match(pattern);
michael@0 599 expectedmatch = null;
michael@0 600 addThis();
michael@0 601
michael@0 602 status = inSection(79);
michael@0 603 pattern = /(?-i:a)b/i;
michael@0 604 string = 'Ab';
michael@0 605 actualmatch = string.match(pattern);
michael@0 606 expectedmatch = null;
michael@0 607 addThis();
michael@0 608
michael@0 609 status = inSection(80);
michael@0 610 pattern = /((?-i:a))b/i;
michael@0 611 string = 'Ab';
michael@0 612 actualmatch = string.match(pattern);
michael@0 613 expectedmatch = null;
michael@0 614 addThis();
michael@0 615
michael@0 616 status = inSection(81);
michael@0 617 pattern = /(?-i:a)b/i;
michael@0 618 string = 'AB';
michael@0 619 actualmatch = string.match(pattern);
michael@0 620 expectedmatch = null;
michael@0 621 addThis();
michael@0 622
michael@0 623 status = inSection(82);
michael@0 624 pattern = /((?-i:a))b/i;
michael@0 625 string = 'AB';
michael@0 626 actualmatch = string.match(pattern);
michael@0 627 expectedmatch = null;
michael@0 628 addThis();
michael@0 629
michael@0 630 status = inSection(83);
michael@0 631 pattern = /((?-i:a.))b/i;
michael@0 632 string = 'a\nB';
michael@0 633 actualmatch = string.match(pattern);
michael@0 634 expectedmatch = null;
michael@0 635 addThis();
michael@0 636
michael@0 637 status = inSection(84);
michael@0 638 pattern = /((?s-i:a.))b/i;
michael@0 639 string = 'B\nB';
michael@0 640 actualmatch = string.match(pattern);
michael@0 641 expectedmatch = null;
michael@0 642 addThis();
michael@0 643 */
michael@0 644
michael@0 645 /* ECMA doesn't support (?<
michael@0 646 status = inSection(85);
michael@0 647 pattern = /(?<![cd])b/;
michael@0 648 string = 'dbcb';
michael@0 649 actualmatch = string.match(pattern);
michael@0 650 expectedmatch = null;
michael@0 651 addThis();
michael@0 652
michael@0 653 status = inSection(86);
michael@0 654 pattern = /(?<!(c|d))b/;
michael@0 655 string = 'dbcb';
michael@0 656 actualmatch = string.match(pattern);
michael@0 657 expectedmatch = null;
michael@0 658 addThis();
michael@0 659 */
michael@0 660
michael@0 661 status = inSection(87);
michael@0 662 pattern = /^(?:a?b?)*$/;
michael@0 663 string = 'a--';
michael@0 664 actualmatch = string.match(pattern);
michael@0 665 expectedmatch = null;
michael@0 666 addThis();
michael@0 667
michael@0 668 status = inSection(88);
michael@0 669 pattern = /^b/;
michael@0 670 string = 'a\nb\nc\n';
michael@0 671 actualmatch = string.match(pattern);
michael@0 672 expectedmatch = null;
michael@0 673 addThis();
michael@0 674
michael@0 675 status = inSection(89);
michael@0 676 pattern = /()^b/;
michael@0 677 string = 'a\nb\nc\n';
michael@0 678 actualmatch = string.match(pattern);
michael@0 679 expectedmatch = null;
michael@0 680 addThis();
michael@0 681
michael@0 682 /* ECMA doesn't support (?(
michael@0 683 status = inSection(90);
michael@0 684 pattern = /(?(1)a|b)/;
michael@0 685 string = 'a';
michael@0 686 actualmatch = string.match(pattern);
michael@0 687 expectedmatch = null;
michael@0 688 addThis();
michael@0 689
michael@0 690 status = inSection(91);
michael@0 691 pattern = /(x)?(?(1)a|b)/;
michael@0 692 string = 'a';
michael@0 693 actualmatch = string.match(pattern);
michael@0 694 expectedmatch = null;
michael@0 695 addThis();
michael@0 696
michael@0 697 status = inSection(92);
michael@0 698 pattern = /()(?(1)b|a)/;
michael@0 699 string = 'a';
michael@0 700 actualmatch = string.match(pattern);
michael@0 701 expectedmatch = null;
michael@0 702 addThis();
michael@0 703
michael@0 704 status = inSection(93);
michael@0 705 pattern = /^(\()?blah(?(1)(\)))$/;
michael@0 706 string = 'blah)';
michael@0 707 actualmatch = string.match(pattern);
michael@0 708 expectedmatch = null;
michael@0 709 addThis();
michael@0 710
michael@0 711 status = inSection(94);
michael@0 712 pattern = /^(\()?blah(?(1)(\)))$/;
michael@0 713 string = '(blah';
michael@0 714 actualmatch = string.match(pattern);
michael@0 715 expectedmatch = null;
michael@0 716 addThis();
michael@0 717
michael@0 718 status = inSection(95);
michael@0 719 pattern = /^(\(+)?blah(?(1)(\)))$/;
michael@0 720 string = 'blah)';
michael@0 721 actualmatch = string.match(pattern);
michael@0 722 expectedmatch = null;
michael@0 723 addThis();
michael@0 724
michael@0 725 status = inSection(96);
michael@0 726 pattern = /^(\(+)?blah(?(1)(\)))$/;
michael@0 727 string = '(blah';
michael@0 728 actualmatch = string.match(pattern);
michael@0 729 expectedmatch = null;
michael@0 730 addThis();
michael@0 731
michael@0 732 status = inSection(97);
michael@0 733 pattern = /(?(?{0})a|b)/;
michael@0 734 string = 'a';
michael@0 735 actualmatch = string.match(pattern);
michael@0 736 expectedmatch = null;
michael@0 737 addThis();
michael@0 738
michael@0 739 status = inSection(98);
michael@0 740 pattern = /(?(?{1})b|a)/;
michael@0 741 string = 'a';
michael@0 742 actualmatch = string.match(pattern);
michael@0 743 expectedmatch = null;
michael@0 744 addThis();
michael@0 745
michael@0 746 status = inSection(99);
michael@0 747 pattern = /(?(?!a)a|b)/;
michael@0 748 string = 'a';
michael@0 749 actualmatch = string.match(pattern);
michael@0 750 expectedmatch = null;
michael@0 751 addThis();
michael@0 752
michael@0 753 status = inSection(100);
michael@0 754 pattern = /(?(?=a)b|a)/;
michael@0 755 string = 'a';
michael@0 756 actualmatch = string.match(pattern);
michael@0 757 expectedmatch = null;
michael@0 758 addThis();
michael@0 759 */
michael@0 760
michael@0 761 status = inSection(101);
michael@0 762 pattern = /^(?=(a+?))\1ab/;
michael@0 763 string = 'aaab';
michael@0 764 actualmatch = string.match(pattern);
michael@0 765 expectedmatch = null;
michael@0 766 addThis();
michael@0 767
michael@0 768 status = inSection(102);
michael@0 769 pattern = /^(?=(a+?))\1ab/;
michael@0 770 string = 'aaab';
michael@0 771 actualmatch = string.match(pattern);
michael@0 772 expectedmatch = null;
michael@0 773 addThis();
michael@0 774
michael@0 775 status = inSection(103);
michael@0 776 pattern = /([\w:]+::)?(\w+)$/;
michael@0 777 string = 'abcd:';
michael@0 778 actualmatch = string.match(pattern);
michael@0 779 expectedmatch = null;
michael@0 780 addThis();
michael@0 781
michael@0 782 status = inSection(104);
michael@0 783 pattern = /([\w:]+::)?(\w+)$/;
michael@0 784 string = 'abcd:';
michael@0 785 actualmatch = string.match(pattern);
michael@0 786 expectedmatch = null;
michael@0 787 addThis();
michael@0 788
michael@0 789 status = inSection(105);
michael@0 790 pattern = /(>a+)ab/;
michael@0 791 string = 'aaab';
michael@0 792 actualmatch = string.match(pattern);
michael@0 793 expectedmatch = null;
michael@0 794 addThis();
michael@0 795
michael@0 796 status = inSection(106);
michael@0 797 pattern = /a\Z/;
michael@0 798 string = 'a\nb\n';
michael@0 799 actualmatch = string.match(pattern);
michael@0 800 expectedmatch = null;
michael@0 801 addThis();
michael@0 802
michael@0 803 status = inSection(107);
michael@0 804 pattern = /a\z/;
michael@0 805 string = 'a\nb\n';
michael@0 806 actualmatch = string.match(pattern);
michael@0 807 expectedmatch = null;
michael@0 808 addThis();
michael@0 809
michael@0 810 status = inSection(108);
michael@0 811 pattern = /a$/;
michael@0 812 string = 'a\nb\n';
michael@0 813 actualmatch = string.match(pattern);
michael@0 814 expectedmatch = null;
michael@0 815 addThis();
michael@0 816
michael@0 817 status = inSection(109);
michael@0 818 pattern = /a\z/;
michael@0 819 string = 'b\na\n';
michael@0 820 actualmatch = string.match(pattern);
michael@0 821 expectedmatch = null;
michael@0 822 addThis();
michael@0 823
michael@0 824 status = inSection(110);
michael@0 825 pattern = /a\z/m;
michael@0 826 string = 'a\nb\n';
michael@0 827 actualmatch = string.match(pattern);
michael@0 828 expectedmatch = null;
michael@0 829 addThis();
michael@0 830
michael@0 831 status = inSection(111);
michael@0 832 pattern = /a\z/m;
michael@0 833 string = 'b\na\n';
michael@0 834 actualmatch = string.match(pattern);
michael@0 835 expectedmatch = null;
michael@0 836 addThis();
michael@0 837
michael@0 838 status = inSection(112);
michael@0 839 pattern = /aa\Z/;
michael@0 840 string = 'aa\nb\n';
michael@0 841 actualmatch = string.match(pattern);
michael@0 842 expectedmatch = null;
michael@0 843 addThis();
michael@0 844
michael@0 845 status = inSection(113);
michael@0 846 pattern = /aa\z/;
michael@0 847 string = 'aa\nb\n';
michael@0 848 actualmatch = string.match(pattern);
michael@0 849 expectedmatch = null;
michael@0 850 addThis();
michael@0 851
michael@0 852 status = inSection(114);
michael@0 853 pattern = /aa$/;
michael@0 854 string = 'aa\nb\n';
michael@0 855 actualmatch = string.match(pattern);
michael@0 856 expectedmatch = null;
michael@0 857 addThis();
michael@0 858
michael@0 859 status = inSection(115);
michael@0 860 pattern = /aa\z/;
michael@0 861 string = 'b\naa\n';
michael@0 862 actualmatch = string.match(pattern);
michael@0 863 expectedmatch = null;
michael@0 864 addThis();
michael@0 865
michael@0 866 status = inSection(116);
michael@0 867 pattern = /aa\z/m;
michael@0 868 string = 'aa\nb\n';
michael@0 869 actualmatch = string.match(pattern);
michael@0 870 expectedmatch = null;
michael@0 871 addThis();
michael@0 872
michael@0 873 status = inSection(117);
michael@0 874 pattern = /aa\z/m;
michael@0 875 string = 'b\naa\n';
michael@0 876 actualmatch = string.match(pattern);
michael@0 877 expectedmatch = null;
michael@0 878 addThis();
michael@0 879
michael@0 880 status = inSection(118);
michael@0 881 pattern = /aa\Z/;
michael@0 882 string = 'ac\nb\n';
michael@0 883 actualmatch = string.match(pattern);
michael@0 884 expectedmatch = null;
michael@0 885 addThis();
michael@0 886
michael@0 887 status = inSection(119);
michael@0 888 pattern = /aa\z/;
michael@0 889 string = 'ac\nb\n';
michael@0 890 actualmatch = string.match(pattern);
michael@0 891 expectedmatch = null;
michael@0 892 addThis();
michael@0 893
michael@0 894 status = inSection(120);
michael@0 895 pattern = /aa$/;
michael@0 896 string = 'ac\nb\n';
michael@0 897 actualmatch = string.match(pattern);
michael@0 898 expectedmatch = null;
michael@0 899 addThis();
michael@0 900
michael@0 901 status = inSection(121);
michael@0 902 pattern = /aa\Z/;
michael@0 903 string = 'b\nac\n';
michael@0 904 actualmatch = string.match(pattern);
michael@0 905 expectedmatch = null;
michael@0 906 addThis();
michael@0 907
michael@0 908 status = inSection(122);
michael@0 909 pattern = /aa\z/;
michael@0 910 string = 'b\nac\n';
michael@0 911 actualmatch = string.match(pattern);
michael@0 912 expectedmatch = null;
michael@0 913 addThis();
michael@0 914
michael@0 915 status = inSection(123);
michael@0 916 pattern = /aa$/;
michael@0 917 string = 'b\nac\n';
michael@0 918 actualmatch = string.match(pattern);
michael@0 919 expectedmatch = null;
michael@0 920 addThis();
michael@0 921
michael@0 922 status = inSection(124);
michael@0 923 pattern = /aa\Z/;
michael@0 924 string = 'b\nac';
michael@0 925 actualmatch = string.match(pattern);
michael@0 926 expectedmatch = null;
michael@0 927 addThis();
michael@0 928
michael@0 929 status = inSection(125);
michael@0 930 pattern = /aa\z/;
michael@0 931 string = 'b\nac';
michael@0 932 actualmatch = string.match(pattern);
michael@0 933 expectedmatch = null;
michael@0 934 addThis();
michael@0 935
michael@0 936 status = inSection(126);
michael@0 937 pattern = /aa$/;
michael@0 938 string = 'b\nac';
michael@0 939 actualmatch = string.match(pattern);
michael@0 940 expectedmatch = null;
michael@0 941 addThis();
michael@0 942
michael@0 943 status = inSection(127);
michael@0 944 pattern = /aa\Z/m;
michael@0 945 string = 'ac\nb\n';
michael@0 946 actualmatch = string.match(pattern);
michael@0 947 expectedmatch = null;
michael@0 948 addThis();
michael@0 949
michael@0 950 status = inSection(128);
michael@0 951 pattern = /aa\z/m;
michael@0 952 string = 'ac\nb\n';
michael@0 953 actualmatch = string.match(pattern);
michael@0 954 expectedmatch = null;
michael@0 955 addThis();
michael@0 956
michael@0 957 status = inSection(129);
michael@0 958 pattern = /aa$/m;
michael@0 959 string = 'ac\nb\n';
michael@0 960 actualmatch = string.match(pattern);
michael@0 961 expectedmatch = null;
michael@0 962 addThis();
michael@0 963
michael@0 964 status = inSection(130);
michael@0 965 pattern = /aa\Z/m;
michael@0 966 string = 'b\nac\n';
michael@0 967 actualmatch = string.match(pattern);
michael@0 968 expectedmatch = null;
michael@0 969 addThis();
michael@0 970
michael@0 971 status = inSection(131);
michael@0 972 pattern = /aa\z/m;
michael@0 973 string = 'b\nac\n';
michael@0 974 actualmatch = string.match(pattern);
michael@0 975 expectedmatch = null;
michael@0 976 addThis();
michael@0 977
michael@0 978 status = inSection(132);
michael@0 979 pattern = /aa$/m;
michael@0 980 string = 'b\nac\n';
michael@0 981 actualmatch = string.match(pattern);
michael@0 982 expectedmatch = null;
michael@0 983 addThis();
michael@0 984
michael@0 985 status = inSection(133);
michael@0 986 pattern = /aa\Z/m;
michael@0 987 string = 'b\nac';
michael@0 988 actualmatch = string.match(pattern);
michael@0 989 expectedmatch = null;
michael@0 990 addThis();
michael@0 991
michael@0 992 status = inSection(134);
michael@0 993 pattern = /aa\z/m;
michael@0 994 string = 'b\nac';
michael@0 995 actualmatch = string.match(pattern);
michael@0 996 expectedmatch = null;
michael@0 997 addThis();
michael@0 998
michael@0 999 status = inSection(135);
michael@0 1000 pattern = /aa$/m;
michael@0 1001 string = 'b\nac';
michael@0 1002 actualmatch = string.match(pattern);
michael@0 1003 expectedmatch = null;
michael@0 1004 addThis();
michael@0 1005
michael@0 1006 status = inSection(136);
michael@0 1007 pattern = /aa\Z/;
michael@0 1008 string = 'ca\nb\n';
michael@0 1009 actualmatch = string.match(pattern);
michael@0 1010 expectedmatch = null;
michael@0 1011 addThis();
michael@0 1012
michael@0 1013 status = inSection(137);
michael@0 1014 pattern = /aa\z/;
michael@0 1015 string = 'ca\nb\n';
michael@0 1016 actualmatch = string.match(pattern);
michael@0 1017 expectedmatch = null;
michael@0 1018 addThis();
michael@0 1019
michael@0 1020 status = inSection(138);
michael@0 1021 pattern = /aa$/;
michael@0 1022 string = 'ca\nb\n';
michael@0 1023 actualmatch = string.match(pattern);
michael@0 1024 expectedmatch = null;
michael@0 1025 addThis();
michael@0 1026
michael@0 1027 status = inSection(139);
michael@0 1028 pattern = /aa\Z/;
michael@0 1029 string = 'b\nca\n';
michael@0 1030 actualmatch = string.match(pattern);
michael@0 1031 expectedmatch = null;
michael@0 1032 addThis();
michael@0 1033
michael@0 1034 status = inSection(140);
michael@0 1035 pattern = /aa\z/;
michael@0 1036 string = 'b\nca\n';
michael@0 1037 actualmatch = string.match(pattern);
michael@0 1038 expectedmatch = null;
michael@0 1039 addThis();
michael@0 1040
michael@0 1041 status = inSection(141);
michael@0 1042 pattern = /aa$/;
michael@0 1043 string = 'b\nca\n';
michael@0 1044 actualmatch = string.match(pattern);
michael@0 1045 expectedmatch = null;
michael@0 1046 addThis();
michael@0 1047
michael@0 1048 status = inSection(142);
michael@0 1049 pattern = /aa\Z/;
michael@0 1050 string = 'b\nca';
michael@0 1051 actualmatch = string.match(pattern);
michael@0 1052 expectedmatch = null;
michael@0 1053 addThis();
michael@0 1054
michael@0 1055 status = inSection(143);
michael@0 1056 pattern = /aa\z/;
michael@0 1057 string = 'b\nca';
michael@0 1058 actualmatch = string.match(pattern);
michael@0 1059 expectedmatch = null;
michael@0 1060 addThis();
michael@0 1061
michael@0 1062 status = inSection(144);
michael@0 1063 pattern = /aa$/;
michael@0 1064 string = 'b\nca';
michael@0 1065 actualmatch = string.match(pattern);
michael@0 1066 expectedmatch = null;
michael@0 1067 addThis();
michael@0 1068
michael@0 1069 status = inSection(145);
michael@0 1070 pattern = /aa\Z/m;
michael@0 1071 string = 'ca\nb\n';
michael@0 1072 actualmatch = string.match(pattern);
michael@0 1073 expectedmatch = null;
michael@0 1074 addThis();
michael@0 1075
michael@0 1076 status = inSection(146);
michael@0 1077 pattern = /aa\z/m;
michael@0 1078 string = 'ca\nb\n';
michael@0 1079 actualmatch = string.match(pattern);
michael@0 1080 expectedmatch = null;
michael@0 1081 addThis();
michael@0 1082
michael@0 1083 status = inSection(147);
michael@0 1084 pattern = /aa$/m;
michael@0 1085 string = 'ca\nb\n';
michael@0 1086 actualmatch = string.match(pattern);
michael@0 1087 expectedmatch = null;
michael@0 1088 addThis();
michael@0 1089
michael@0 1090 status = inSection(148);
michael@0 1091 pattern = /aa\Z/m;
michael@0 1092 string = 'b\nca\n';
michael@0 1093 actualmatch = string.match(pattern);
michael@0 1094 expectedmatch = null;
michael@0 1095 addThis();
michael@0 1096
michael@0 1097 status = inSection(149);
michael@0 1098 pattern = /aa\z/m;
michael@0 1099 string = 'b\nca\n';
michael@0 1100 actualmatch = string.match(pattern);
michael@0 1101 expectedmatch = null;
michael@0 1102 addThis();
michael@0 1103
michael@0 1104 status = inSection(150);
michael@0 1105 pattern = /aa$/m;
michael@0 1106 string = 'b\nca\n';
michael@0 1107 actualmatch = string.match(pattern);
michael@0 1108 expectedmatch = null;
michael@0 1109 addThis();
michael@0 1110
michael@0 1111 status = inSection(151);
michael@0 1112 pattern = /aa\Z/m;
michael@0 1113 string = 'b\nca';
michael@0 1114 actualmatch = string.match(pattern);
michael@0 1115 expectedmatch = null;
michael@0 1116 addThis();
michael@0 1117
michael@0 1118 status = inSection(152);
michael@0 1119 pattern = /aa\z/m;
michael@0 1120 string = 'b\nca';
michael@0 1121 actualmatch = string.match(pattern);
michael@0 1122 expectedmatch = null;
michael@0 1123 addThis();
michael@0 1124
michael@0 1125 status = inSection(153);
michael@0 1126 pattern = /aa$/m;
michael@0 1127 string = 'b\nca';
michael@0 1128 actualmatch = string.match(pattern);
michael@0 1129 expectedmatch = null;
michael@0 1130 addThis();
michael@0 1131
michael@0 1132 status = inSection(154);
michael@0 1133 pattern = /ab\Z/;
michael@0 1134 string = 'ab\nb\n';
michael@0 1135 actualmatch = string.match(pattern);
michael@0 1136 expectedmatch = null;
michael@0 1137 addThis();
michael@0 1138
michael@0 1139 status = inSection(155);
michael@0 1140 pattern = /ab\z/;
michael@0 1141 string = 'ab\nb\n';
michael@0 1142 actualmatch = string.match(pattern);
michael@0 1143 expectedmatch = null;
michael@0 1144 addThis();
michael@0 1145
michael@0 1146 status = inSection(156);
michael@0 1147 pattern = /ab$/;
michael@0 1148 string = 'ab\nb\n';
michael@0 1149 actualmatch = string.match(pattern);
michael@0 1150 expectedmatch = null;
michael@0 1151 addThis();
michael@0 1152
michael@0 1153 status = inSection(157);
michael@0 1154 pattern = /ab\z/;
michael@0 1155 string = 'b\nab\n';
michael@0 1156 actualmatch = string.match(pattern);
michael@0 1157 expectedmatch = null;
michael@0 1158 addThis();
michael@0 1159
michael@0 1160 status = inSection(158);
michael@0 1161 pattern = /ab\z/m;
michael@0 1162 string = 'ab\nb\n';
michael@0 1163 actualmatch = string.match(pattern);
michael@0 1164 expectedmatch = null;
michael@0 1165 addThis();
michael@0 1166
michael@0 1167 status = inSection(159);
michael@0 1168 pattern = /ab\z/m;
michael@0 1169 string = 'b\nab\n';
michael@0 1170 actualmatch = string.match(pattern);
michael@0 1171 expectedmatch = null;
michael@0 1172 addThis();
michael@0 1173
michael@0 1174 status = inSection(160);
michael@0 1175 pattern = /ab\Z/;
michael@0 1176 string = 'ac\nb\n';
michael@0 1177 actualmatch = string.match(pattern);
michael@0 1178 expectedmatch = null;
michael@0 1179 addThis();
michael@0 1180
michael@0 1181 status = inSection(161);
michael@0 1182 pattern = /ab\z/;
michael@0 1183 string = 'ac\nb\n';
michael@0 1184 actualmatch = string.match(pattern);
michael@0 1185 expectedmatch = null;
michael@0 1186 addThis();
michael@0 1187
michael@0 1188 status = inSection(162);
michael@0 1189 pattern = /ab$/;
michael@0 1190 string = 'ac\nb\n';
michael@0 1191 actualmatch = string.match(pattern);
michael@0 1192 expectedmatch = null;
michael@0 1193 addThis();
michael@0 1194
michael@0 1195 status = inSection(163);
michael@0 1196 pattern = /ab\Z/;
michael@0 1197 string = 'b\nac\n';
michael@0 1198 actualmatch = string.match(pattern);
michael@0 1199 expectedmatch = null;
michael@0 1200 addThis();
michael@0 1201
michael@0 1202 status = inSection(164);
michael@0 1203 pattern = /ab\z/;
michael@0 1204 string = 'b\nac\n';
michael@0 1205 actualmatch = string.match(pattern);
michael@0 1206 expectedmatch = null;
michael@0 1207 addThis();
michael@0 1208
michael@0 1209 status = inSection(165);
michael@0 1210 pattern = /ab$/;
michael@0 1211 string = 'b\nac\n';
michael@0 1212 actualmatch = string.match(pattern);
michael@0 1213 expectedmatch = null;
michael@0 1214 addThis();
michael@0 1215
michael@0 1216 status = inSection(166);
michael@0 1217 pattern = /ab\Z/;
michael@0 1218 string = 'b\nac';
michael@0 1219 actualmatch = string.match(pattern);
michael@0 1220 expectedmatch = null;
michael@0 1221 addThis();
michael@0 1222
michael@0 1223 status = inSection(167);
michael@0 1224 pattern = /ab\z/;
michael@0 1225 string = 'b\nac';
michael@0 1226 actualmatch = string.match(pattern);
michael@0 1227 expectedmatch = null;
michael@0 1228 addThis();
michael@0 1229
michael@0 1230 status = inSection(168);
michael@0 1231 pattern = /ab$/;
michael@0 1232 string = 'b\nac';
michael@0 1233 actualmatch = string.match(pattern);
michael@0 1234 expectedmatch = null;
michael@0 1235 addThis();
michael@0 1236
michael@0 1237 status = inSection(169);
michael@0 1238 pattern = /ab\Z/m;
michael@0 1239 string = 'ac\nb\n';
michael@0 1240 actualmatch = string.match(pattern);
michael@0 1241 expectedmatch = null;
michael@0 1242 addThis();
michael@0 1243
michael@0 1244 status = inSection(170);
michael@0 1245 pattern = /ab\z/m;
michael@0 1246 string = 'ac\nb\n';
michael@0 1247 actualmatch = string.match(pattern);
michael@0 1248 expectedmatch = null;
michael@0 1249 addThis();
michael@0 1250
michael@0 1251 status = inSection(171);
michael@0 1252 pattern = /ab$/m;
michael@0 1253 string = 'ac\nb\n';
michael@0 1254 actualmatch = string.match(pattern);
michael@0 1255 expectedmatch = null;
michael@0 1256 addThis();
michael@0 1257
michael@0 1258 status = inSection(172);
michael@0 1259 pattern = /ab\Z/m;
michael@0 1260 string = 'b\nac\n';
michael@0 1261 actualmatch = string.match(pattern);
michael@0 1262 expectedmatch = null;
michael@0 1263 addThis();
michael@0 1264
michael@0 1265 status = inSection(173);
michael@0 1266 pattern = /ab\z/m;
michael@0 1267 string = 'b\nac\n';
michael@0 1268 actualmatch = string.match(pattern);
michael@0 1269 expectedmatch = null;
michael@0 1270 addThis();
michael@0 1271
michael@0 1272 status = inSection(174);
michael@0 1273 pattern = /ab$/m;
michael@0 1274 string = 'b\nac\n';
michael@0 1275 actualmatch = string.match(pattern);
michael@0 1276 expectedmatch = null;
michael@0 1277 addThis();
michael@0 1278
michael@0 1279 status = inSection(175);
michael@0 1280 pattern = /ab\Z/m;
michael@0 1281 string = 'b\nac';
michael@0 1282 actualmatch = string.match(pattern);
michael@0 1283 expectedmatch = null;
michael@0 1284 addThis();
michael@0 1285
michael@0 1286 status = inSection(176);
michael@0 1287 pattern = /ab\z/m;
michael@0 1288 string = 'b\nac';
michael@0 1289 actualmatch = string.match(pattern);
michael@0 1290 expectedmatch = null;
michael@0 1291 addThis();
michael@0 1292
michael@0 1293 status = inSection(177);
michael@0 1294 pattern = /ab$/m;
michael@0 1295 string = 'b\nac';
michael@0 1296 actualmatch = string.match(pattern);
michael@0 1297 expectedmatch = null;
michael@0 1298 addThis();
michael@0 1299
michael@0 1300 status = inSection(178);
michael@0 1301 pattern = /ab\Z/;
michael@0 1302 string = 'ca\nb\n';
michael@0 1303 actualmatch = string.match(pattern);
michael@0 1304 expectedmatch = null;
michael@0 1305 addThis();
michael@0 1306
michael@0 1307 status = inSection(179);
michael@0 1308 pattern = /ab\z/;
michael@0 1309 string = 'ca\nb\n';
michael@0 1310 actualmatch = string.match(pattern);
michael@0 1311 expectedmatch = null;
michael@0 1312 addThis();
michael@0 1313
michael@0 1314 status = inSection(180);
michael@0 1315 pattern = /ab$/;
michael@0 1316 string = 'ca\nb\n';
michael@0 1317 actualmatch = string.match(pattern);
michael@0 1318 expectedmatch = null;
michael@0 1319 addThis();
michael@0 1320
michael@0 1321 status = inSection(181);
michael@0 1322 pattern = /ab\Z/;
michael@0 1323 string = 'b\nca\n';
michael@0 1324 actualmatch = string.match(pattern);
michael@0 1325 expectedmatch = null;
michael@0 1326 addThis();
michael@0 1327
michael@0 1328 status = inSection(182);
michael@0 1329 pattern = /ab\z/;
michael@0 1330 string = 'b\nca\n';
michael@0 1331 actualmatch = string.match(pattern);
michael@0 1332 expectedmatch = null;
michael@0 1333 addThis();
michael@0 1334
michael@0 1335 status = inSection(183);
michael@0 1336 pattern = /ab$/;
michael@0 1337 string = 'b\nca\n';
michael@0 1338 actualmatch = string.match(pattern);
michael@0 1339 expectedmatch = null;
michael@0 1340 addThis();
michael@0 1341
michael@0 1342 status = inSection(184);
michael@0 1343 pattern = /ab\Z/;
michael@0 1344 string = 'b\nca';
michael@0 1345 actualmatch = string.match(pattern);
michael@0 1346 expectedmatch = null;
michael@0 1347 addThis();
michael@0 1348
michael@0 1349 status = inSection(185);
michael@0 1350 pattern = /ab\z/;
michael@0 1351 string = 'b\nca';
michael@0 1352 actualmatch = string.match(pattern);
michael@0 1353 expectedmatch = null;
michael@0 1354 addThis();
michael@0 1355
michael@0 1356 status = inSection(186);
michael@0 1357 pattern = /ab$/;
michael@0 1358 string = 'b\nca';
michael@0 1359 actualmatch = string.match(pattern);
michael@0 1360 expectedmatch = null;
michael@0 1361 addThis();
michael@0 1362
michael@0 1363 status = inSection(187);
michael@0 1364 pattern = /ab\Z/m;
michael@0 1365 string = 'ca\nb\n';
michael@0 1366 actualmatch = string.match(pattern);
michael@0 1367 expectedmatch = null;
michael@0 1368 addThis();
michael@0 1369
michael@0 1370 status = inSection(188);
michael@0 1371 pattern = /ab\z/m;
michael@0 1372 string = 'ca\nb\n';
michael@0 1373 actualmatch = string.match(pattern);
michael@0 1374 expectedmatch = null;
michael@0 1375 addThis();
michael@0 1376
michael@0 1377 status = inSection(189);
michael@0 1378 pattern = /ab$/m;
michael@0 1379 string = 'ca\nb\n';
michael@0 1380 actualmatch = string.match(pattern);
michael@0 1381 expectedmatch = null;
michael@0 1382 addThis();
michael@0 1383
michael@0 1384 status = inSection(190);
michael@0 1385 pattern = /ab\Z/m;
michael@0 1386 string = 'b\nca\n';
michael@0 1387 actualmatch = string.match(pattern);
michael@0 1388 expectedmatch = null;
michael@0 1389 addThis();
michael@0 1390
michael@0 1391 status = inSection(191);
michael@0 1392 pattern = /ab\z/m;
michael@0 1393 string = 'b\nca\n';
michael@0 1394 actualmatch = string.match(pattern);
michael@0 1395 expectedmatch = null;
michael@0 1396 addThis();
michael@0 1397
michael@0 1398 status = inSection(192);
michael@0 1399 pattern = /ab$/m;
michael@0 1400 string = 'b\nca\n';
michael@0 1401 actualmatch = string.match(pattern);
michael@0 1402 expectedmatch = null;
michael@0 1403 addThis();
michael@0 1404
michael@0 1405 status = inSection(193);
michael@0 1406 pattern = /ab\Z/m;
michael@0 1407 string = 'b\nca';
michael@0 1408 actualmatch = string.match(pattern);
michael@0 1409 expectedmatch = null;
michael@0 1410 addThis();
michael@0 1411
michael@0 1412 status = inSection(194);
michael@0 1413 pattern = /ab\z/m;
michael@0 1414 string = 'b\nca';
michael@0 1415 actualmatch = string.match(pattern);
michael@0 1416 expectedmatch = null;
michael@0 1417 addThis();
michael@0 1418
michael@0 1419 status = inSection(195);
michael@0 1420 pattern = /ab$/m;
michael@0 1421 string = 'b\nca';
michael@0 1422 actualmatch = string.match(pattern);
michael@0 1423 expectedmatch = null;
michael@0 1424 addThis();
michael@0 1425
michael@0 1426 status = inSection(196);
michael@0 1427 pattern = /abb\Z/;
michael@0 1428 string = 'abb\nb\n';
michael@0 1429 actualmatch = string.match(pattern);
michael@0 1430 expectedmatch = null;
michael@0 1431 addThis();
michael@0 1432
michael@0 1433 status = inSection(197);
michael@0 1434 pattern = /abb\z/;
michael@0 1435 string = 'abb\nb\n';
michael@0 1436 actualmatch = string.match(pattern);
michael@0 1437 expectedmatch = null;
michael@0 1438 addThis();
michael@0 1439
michael@0 1440 status = inSection(198);
michael@0 1441 pattern = /abb$/;
michael@0 1442 string = 'abb\nb\n';
michael@0 1443 actualmatch = string.match(pattern);
michael@0 1444 expectedmatch = null;
michael@0 1445 addThis();
michael@0 1446
michael@0 1447 status = inSection(199);
michael@0 1448 pattern = /abb\z/;
michael@0 1449 string = 'b\nabb\n';
michael@0 1450 actualmatch = string.match(pattern);
michael@0 1451 expectedmatch = null;
michael@0 1452 addThis();
michael@0 1453
michael@0 1454 status = inSection(200);
michael@0 1455 pattern = /abb\z/m;
michael@0 1456 string = 'abb\nb\n';
michael@0 1457 actualmatch = string.match(pattern);
michael@0 1458 expectedmatch = null;
michael@0 1459 addThis();
michael@0 1460
michael@0 1461 status = inSection(201);
michael@0 1462 pattern = /abb\z/m;
michael@0 1463 string = 'b\nabb\n';
michael@0 1464 actualmatch = string.match(pattern);
michael@0 1465 expectedmatch = null;
michael@0 1466 addThis();
michael@0 1467
michael@0 1468 status = inSection(202);
michael@0 1469 pattern = /abb\Z/;
michael@0 1470 string = 'ac\nb\n';
michael@0 1471 actualmatch = string.match(pattern);
michael@0 1472 expectedmatch = null;
michael@0 1473 addThis();
michael@0 1474
michael@0 1475 status = inSection(203);
michael@0 1476 pattern = /abb\z/;
michael@0 1477 string = 'ac\nb\n';
michael@0 1478 actualmatch = string.match(pattern);
michael@0 1479 expectedmatch = null;
michael@0 1480 addThis();
michael@0 1481
michael@0 1482 status = inSection(204);
michael@0 1483 pattern = /abb$/;
michael@0 1484 string = 'ac\nb\n';
michael@0 1485 actualmatch = string.match(pattern);
michael@0 1486 expectedmatch = null;
michael@0 1487 addThis();
michael@0 1488
michael@0 1489 status = inSection(205);
michael@0 1490 pattern = /abb\Z/;
michael@0 1491 string = 'b\nac\n';
michael@0 1492 actualmatch = string.match(pattern);
michael@0 1493 expectedmatch = null;
michael@0 1494 addThis();
michael@0 1495
michael@0 1496 status = inSection(206);
michael@0 1497 pattern = /abb\z/;
michael@0 1498 string = 'b\nac\n';
michael@0 1499 actualmatch = string.match(pattern);
michael@0 1500 expectedmatch = null;
michael@0 1501 addThis();
michael@0 1502
michael@0 1503 status = inSection(207);
michael@0 1504 pattern = /abb$/;
michael@0 1505 string = 'b\nac\n';
michael@0 1506 actualmatch = string.match(pattern);
michael@0 1507 expectedmatch = null;
michael@0 1508 addThis();
michael@0 1509
michael@0 1510 status = inSection(208);
michael@0 1511 pattern = /abb\Z/;
michael@0 1512 string = 'b\nac';
michael@0 1513 actualmatch = string.match(pattern);
michael@0 1514 expectedmatch = null;
michael@0 1515 addThis();
michael@0 1516
michael@0 1517 status = inSection(209);
michael@0 1518 pattern = /abb\z/;
michael@0 1519 string = 'b\nac';
michael@0 1520 actualmatch = string.match(pattern);
michael@0 1521 expectedmatch = null;
michael@0 1522 addThis();
michael@0 1523
michael@0 1524 status = inSection(210);
michael@0 1525 pattern = /abb$/;
michael@0 1526 string = 'b\nac';
michael@0 1527 actualmatch = string.match(pattern);
michael@0 1528 expectedmatch = null;
michael@0 1529 addThis();
michael@0 1530
michael@0 1531 status = inSection(211);
michael@0 1532 pattern = /abb\Z/m;
michael@0 1533 string = 'ac\nb\n';
michael@0 1534 actualmatch = string.match(pattern);
michael@0 1535 expectedmatch = null;
michael@0 1536 addThis();
michael@0 1537
michael@0 1538 status = inSection(212);
michael@0 1539 pattern = /abb\z/m;
michael@0 1540 string = 'ac\nb\n';
michael@0 1541 actualmatch = string.match(pattern);
michael@0 1542 expectedmatch = null;
michael@0 1543 addThis();
michael@0 1544
michael@0 1545 status = inSection(213);
michael@0 1546 pattern = /abb$/m;
michael@0 1547 string = 'ac\nb\n';
michael@0 1548 actualmatch = string.match(pattern);
michael@0 1549 expectedmatch = null;
michael@0 1550 addThis();
michael@0 1551
michael@0 1552 status = inSection(214);
michael@0 1553 pattern = /abb\Z/m;
michael@0 1554 string = 'b\nac\n';
michael@0 1555 actualmatch = string.match(pattern);
michael@0 1556 expectedmatch = null;
michael@0 1557 addThis();
michael@0 1558
michael@0 1559 status = inSection(215);
michael@0 1560 pattern = /abb\z/m;
michael@0 1561 string = 'b\nac\n';
michael@0 1562 actualmatch = string.match(pattern);
michael@0 1563 expectedmatch = null;
michael@0 1564 addThis();
michael@0 1565
michael@0 1566 status = inSection(216);
michael@0 1567 pattern = /abb$/m;
michael@0 1568 string = 'b\nac\n';
michael@0 1569 actualmatch = string.match(pattern);
michael@0 1570 expectedmatch = null;
michael@0 1571 addThis();
michael@0 1572
michael@0 1573 status = inSection(217);
michael@0 1574 pattern = /abb\Z/m;
michael@0 1575 string = 'b\nac';
michael@0 1576 actualmatch = string.match(pattern);
michael@0 1577 expectedmatch = null;
michael@0 1578 addThis();
michael@0 1579
michael@0 1580 status = inSection(218);
michael@0 1581 pattern = /abb\z/m;
michael@0 1582 string = 'b\nac';
michael@0 1583 actualmatch = string.match(pattern);
michael@0 1584 expectedmatch = null;
michael@0 1585 addThis();
michael@0 1586
michael@0 1587 status = inSection(219);
michael@0 1588 pattern = /abb$/m;
michael@0 1589 string = 'b\nac';
michael@0 1590 actualmatch = string.match(pattern);
michael@0 1591 expectedmatch = null;
michael@0 1592 addThis();
michael@0 1593
michael@0 1594 status = inSection(220);
michael@0 1595 pattern = /abb\Z/;
michael@0 1596 string = 'ca\nb\n';
michael@0 1597 actualmatch = string.match(pattern);
michael@0 1598 expectedmatch = null;
michael@0 1599 addThis();
michael@0 1600
michael@0 1601 status = inSection(221);
michael@0 1602 pattern = /abb\z/;
michael@0 1603 string = 'ca\nb\n';
michael@0 1604 actualmatch = string.match(pattern);
michael@0 1605 expectedmatch = null;
michael@0 1606 addThis();
michael@0 1607
michael@0 1608 status = inSection(222);
michael@0 1609 pattern = /abb$/;
michael@0 1610 string = 'ca\nb\n';
michael@0 1611 actualmatch = string.match(pattern);
michael@0 1612 expectedmatch = null;
michael@0 1613 addThis();
michael@0 1614
michael@0 1615 status = inSection(223);
michael@0 1616 pattern = /abb\Z/;
michael@0 1617 string = 'b\nca\n';
michael@0 1618 actualmatch = string.match(pattern);
michael@0 1619 expectedmatch = null;
michael@0 1620 addThis();
michael@0 1621
michael@0 1622 status = inSection(224);
michael@0 1623 pattern = /abb\z/;
michael@0 1624 string = 'b\nca\n';
michael@0 1625 actualmatch = string.match(pattern);
michael@0 1626 expectedmatch = null;
michael@0 1627 addThis();
michael@0 1628
michael@0 1629 status = inSection(225);
michael@0 1630 pattern = /abb$/;
michael@0 1631 string = 'b\nca\n';
michael@0 1632 actualmatch = string.match(pattern);
michael@0 1633 expectedmatch = null;
michael@0 1634 addThis();
michael@0 1635
michael@0 1636 status = inSection(226);
michael@0 1637 pattern = /abb\Z/;
michael@0 1638 string = 'b\nca';
michael@0 1639 actualmatch = string.match(pattern);
michael@0 1640 expectedmatch = null;
michael@0 1641 addThis();
michael@0 1642
michael@0 1643 status = inSection(227);
michael@0 1644 pattern = /abb\z/;
michael@0 1645 string = 'b\nca';
michael@0 1646 actualmatch = string.match(pattern);
michael@0 1647 expectedmatch = null;
michael@0 1648 addThis();
michael@0 1649
michael@0 1650 status = inSection(228);
michael@0 1651 pattern = /abb$/;
michael@0 1652 string = 'b\nca';
michael@0 1653 actualmatch = string.match(pattern);
michael@0 1654 expectedmatch = null;
michael@0 1655 addThis();
michael@0 1656
michael@0 1657 status = inSection(229);
michael@0 1658 pattern = /abb\Z/m;
michael@0 1659 string = 'ca\nb\n';
michael@0 1660 actualmatch = string.match(pattern);
michael@0 1661 expectedmatch = null;
michael@0 1662 addThis();
michael@0 1663
michael@0 1664 status = inSection(230);
michael@0 1665 pattern = /abb\z/m;
michael@0 1666 string = 'ca\nb\n';
michael@0 1667 actualmatch = string.match(pattern);
michael@0 1668 expectedmatch = null;
michael@0 1669 addThis();
michael@0 1670
michael@0 1671 status = inSection(231);
michael@0 1672 pattern = /abb$/m;
michael@0 1673 string = 'ca\nb\n';
michael@0 1674 actualmatch = string.match(pattern);
michael@0 1675 expectedmatch = null;
michael@0 1676 addThis();
michael@0 1677
michael@0 1678 status = inSection(232);
michael@0 1679 pattern = /abb\Z/m;
michael@0 1680 string = 'b\nca\n';
michael@0 1681 actualmatch = string.match(pattern);
michael@0 1682 expectedmatch = null;
michael@0 1683 addThis();
michael@0 1684
michael@0 1685 status = inSection(233);
michael@0 1686 pattern = /abb\z/m;
michael@0 1687 string = 'b\nca\n';
michael@0 1688 actualmatch = string.match(pattern);
michael@0 1689 expectedmatch = null;
michael@0 1690 addThis();
michael@0 1691
michael@0 1692 status = inSection(234);
michael@0 1693 pattern = /abb$/m;
michael@0 1694 string = 'b\nca\n';
michael@0 1695 actualmatch = string.match(pattern);
michael@0 1696 expectedmatch = null;
michael@0 1697 addThis();
michael@0 1698
michael@0 1699 status = inSection(235);
michael@0 1700 pattern = /abb\Z/m;
michael@0 1701 string = 'b\nca';
michael@0 1702 actualmatch = string.match(pattern);
michael@0 1703 expectedmatch = null;
michael@0 1704 addThis();
michael@0 1705
michael@0 1706 status = inSection(236);
michael@0 1707 pattern = /abb\z/m;
michael@0 1708 string = 'b\nca';
michael@0 1709 actualmatch = string.match(pattern);
michael@0 1710 expectedmatch = null;
michael@0 1711 addThis();
michael@0 1712
michael@0 1713 status = inSection(237);
michael@0 1714 pattern = /abb$/m;
michael@0 1715 string = 'b\nca';
michael@0 1716 actualmatch = string.match(pattern);
michael@0 1717 expectedmatch = null;
michael@0 1718 addThis();
michael@0 1719
michael@0 1720 status = inSection(238);
michael@0 1721 pattern = /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/;
michael@0 1722 string = 'x';
michael@0 1723 actualmatch = string.match(pattern);
michael@0 1724 expectedmatch = null;
michael@0 1725 addThis();
michael@0 1726
michael@0 1727 status = inSection(239);
michael@0 1728 pattern = /\GX.*X/;
michael@0 1729 string = 'aaaXbX';
michael@0 1730 actualmatch = string.match(pattern);
michael@0 1731 expectedmatch = null;
michael@0 1732 addThis();
michael@0 1733
michael@0 1734 status = inSection(240);
michael@0 1735 pattern = /\.c(pp|xx|c)?$/i;
michael@0 1736 string = 'Changes';
michael@0 1737 actualmatch = string.match(pattern);
michael@0 1738 expectedmatch = null;
michael@0 1739 addThis();
michael@0 1740
michael@0 1741 status = inSection(241);
michael@0 1742 pattern = /^([a-z]:)/;
michael@0 1743 string = 'C:/';
michael@0 1744 actualmatch = string.match(pattern);
michael@0 1745 expectedmatch = null;
michael@0 1746 addThis();
michael@0 1747
michael@0 1748 status = inSection(242);
michael@0 1749 pattern = /(\w)?(abc)\1b/;
michael@0 1750 string = 'abcab';
michael@0 1751 actualmatch = string.match(pattern);
michael@0 1752 expectedmatch = null;
michael@0 1753 addThis();
michael@0 1754
michael@0 1755 /* ECMA doesn't support (?(
michael@0 1756 status = inSection(243);
michael@0 1757 pattern = /^(a)?(?(1)a|b)+$/;
michael@0 1758 string = 'a';
michael@0 1759 actualmatch = string.match(pattern);
michael@0 1760 expectedmatch = null;
michael@0 1761 addThis();
michael@0 1762 */
michael@0 1763
michael@0 1764
michael@0 1765
michael@0 1766 //-----------------------------------------------------------------------------
michael@0 1767 test();
michael@0 1768 //-----------------------------------------------------------------------------
michael@0 1769
michael@0 1770
michael@0 1771
michael@0 1772 function addThis()
michael@0 1773 {
michael@0 1774 if(omitCurrentSection())
michael@0 1775 return;
michael@0 1776
michael@0 1777 statusmessages[i] = status;
michael@0 1778 patterns[i] = pattern;
michael@0 1779 strings[i] = string;
michael@0 1780 actualmatches[i] = actualmatch;
michael@0 1781 expectedmatches[i] = expectedmatch;
michael@0 1782 i++;
michael@0 1783 }
michael@0 1784
michael@0 1785
michael@0 1786 function omitCurrentSection()
michael@0 1787 {
michael@0 1788 try
michael@0 1789 {
michael@0 1790 // current section number is in global status variable
michael@0 1791 var n = status.match(/(\d+)/)[1];
michael@0 1792 return ((n < cnLBOUND) || (n > cnUBOUND));
michael@0 1793 }
michael@0 1794 catch(e)
michael@0 1795 {
michael@0 1796 return false;
michael@0 1797 }
michael@0 1798 }
michael@0 1799
michael@0 1800
michael@0 1801 function test()
michael@0 1802 {
michael@0 1803 enterFunc ('test');
michael@0 1804 printBugNumber(BUGNUMBER);
michael@0 1805 printStatus (summary);
michael@0 1806 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
michael@0 1807 exitFunc ('test');
michael@0 1808 }

mercurial