js/src/tests/js1_2/regexp/RegExp_leftContext.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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    Filename:     RegExp_leftContext.js
     9    Description:  'Tests RegExps leftContext property'
    11    Author:       Nick Lerissa
    12    Date:         March 12, 1998
    13 */
    15 var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
    16 var VERSION = 'no version';
    17 startTest();
    18 var TITLE   = 'RegExp: leftContext';
    20 writeHeaderToLog('Executing script: RegExp_leftContext.js');
    21 writeHeaderToLog( SECTION + " "+ TITLE);
    23 // 'abc123xyz'.match(/123/); RegExp.leftContext
    24 'abc123xyz'.match(/123/);
    25 new TestCase ( SECTION, "'abc123xyz'.match(/123/); RegExp.leftContext",
    26 	       'abc', RegExp.leftContext);
    28 // 'abc123xyz'.match(/456/); RegExp.leftContext
    29 'abc123xyz'.match(/456/);
    30 new TestCase ( SECTION, "'abc123xyz'.match(/456/); RegExp.leftContext",
    31 	       'abc', RegExp.leftContext);
    33 // 'abc123xyz'.match(/abc123xyz/); RegExp.leftContext
    34 'abc123xyz'.match(/abc123xyz/);
    35 new TestCase ( SECTION, "'abc123xyz'.match(/abc123xyz/); RegExp.leftContext",
    36 	       '', RegExp.leftContext);
    38 // 'xxxx'.match(/$/); RegExp.leftContext
    39 'xxxx'.match(/$/);
    40 new TestCase ( SECTION, "'xxxx'.match(/$/); RegExp.leftContext",
    41 	       'xxxx', RegExp.leftContext);
    43 // 'test'.match(/^/); RegExp.leftContext
    44 'test'.match(/^/);
    45 new TestCase ( SECTION, "'test'.match(/^/); RegExp.leftContext",
    46 	       '', RegExp.leftContext);
    48 // 'xxxx'.match(new RegExp('$')); RegExp.leftContext
    49 'xxxx'.match(new RegExp('$'));
    50 new TestCase ( SECTION, "'xxxx'.match(new RegExp('$')); RegExp.leftContext",
    51 	       'xxxx', RegExp.leftContext);
    53 // 'test'.match(new RegExp('^')); RegExp.leftContext
    54 'test'.match(new RegExp('^'));
    55 new TestCase ( SECTION, "'test'.match(new RegExp('^')); RegExp.leftContext",
    56 	       '', RegExp.leftContext);
    58 test();

mercurial