| 1 |
/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ |
| 2 |
/* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 |
* License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 |
|
| 6 |
|
| 7 |
/** |
| 8 |
* File Name: regress-6359.js |
| 9 |
* Reference: ** replace with bugzilla URL or document reference ** |
| 10 |
* Description: ** replace with description of test ** |
| 11 |
* Author: ** replace with your e-mail address ** |
| 12 |
*/ |
| 13 |
|
| 14 |
var SECTION = "js1_2"; // provide a document reference (ie, ECMA section) |
| 15 |
var TITLE = "Regression test for bugzilla # 6359"; // Provide ECMA section title or a description |
| 16 |
var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=6359"; // Provide URL to bugsplat or bugzilla report |
| 17 |
|
| 18 |
printBugNumber(BUGNUMBER); |
| 19 |
|
| 20 |
/* |
| 21 |
* Calls to AddTestCase here. AddTestCase is a function that is defined |
| 22 |
* in shell.js and takes three arguments: |
| 23 |
* - a string representation of what is being tested |
| 24 |
* - the expected result |
| 25 |
* - the actual result |
| 26 |
* |
| 27 |
* For example, a test might look like this: |
| 28 |
* |
| 29 |
* var zip = /[\d]{5}$/; |
| 30 |
* |
| 31 |
* AddTestCase( |
| 32 |
* "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test |
| 33 |
* "02134", // expected result |
| 34 |
* "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result |
| 35 |
* |
| 36 |
*/ |
| 37 |
|
| 38 |
AddTestCase( '/(a*)b\1+/.exec("baaac").length', |
| 39 |
2, |
| 40 |
/(a*)b\1+/.exec("baaac").length ); |
| 41 |
|
| 42 |
AddTestCase( '/(a*)b\1+/.exec("baaac")[0]', |
| 43 |
"b", |
| 44 |
/(a*)b\1+/.exec("baaac")[0]); |
| 45 |
|
| 46 |
AddTestCase( '/(a*)b\1+/.exec("baaac")[1]', |
| 47 |
"", |
| 48 |
/(a*)b\1+/.exec("baaac")[1]); |
| 49 |
|
| 50 |
|
| 51 |
test(); // leave this alone. this executes the test cases and |
| 52 |
// displays results. |