js/src/tests/js1_2/regexp/regress-6359.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.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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/. */
     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  */
    14 var SECTION = "js1_2";       // provide a document reference (ie, ECMA section)
    15 var VERSION = "ECMA_2"; // Version of JavaScript or ECMA
    16 var TITLE   = "Regression test for bugzilla # 6359";       // Provide ECMA section title or a description
    17 var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=6359";     // Provide URL to bugsplat or bugzilla report
    19 startTest();               // leave this alone
    21 /*
    22  * Calls to AddTestCase here. AddTestCase is a function that is defined
    23  * in shell.js and takes three arguments:
    24  * - a string representation of what is being tested
    25  * - the expected result
    26  * - the actual result
    27  *
    28  * For example, a test might look like this:
    29  *
    30  * var zip = /[\d]{5}$/;
    31  *
    32  * AddTestCase(
    33  * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)",   // description of the test
    34  *  "02134",                                                           // expected result
    35  *  "PO Box 12345 Boston, MA 02134".match(zip) );                      // actual result
    36  *
    37  */
    39 AddTestCase( '/(a*)b\1+/.exec("baaac").length',
    40 	     2,
    41 	     /(a*)b\1+/.exec("baaac").length );
    43 AddTestCase( '/(a*)b\1+/.exec("baaac")[0]',
    44 	     "b",
    45 	     /(a*)b\1+/.exec("baaac")[0]);
    47 AddTestCase( '/(a*)b\1+/.exec("baaac")[1]',
    48 	     "",
    49 	     /(a*)b\1+/.exec("baaac")[1]);
    52 test();       // leave this alone.  this executes the test cases and
    53 // displays results.

mercurial