js/src/tests/js1_2/regexp/RegExp_rightContext.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    Filename:     RegExp_rightContext.js
     9    Description:  'Tests RegExps rightContext 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: rightContext';
    20 writeHeaderToLog('Executing script: RegExp_rightContext.js');
    21 writeHeaderToLog( SECTION + " "+ TITLE);
    23 // 'abc123xyz'.match(/123/); RegExp.rightContext
    24 'abc123xyz'.match(/123/);
    25 new TestCase ( SECTION, "'abc123xyz'.match(/123/); RegExp.rightContext",
    26 	       'xyz', RegExp.rightContext);
    28 // 'abc123xyz'.match(/456/); RegExp.rightContext
    29 'abc123xyz'.match(/456/);
    30 new TestCase ( SECTION, "'abc123xyz'.match(/456/); RegExp.rightContext",
    31 	       'xyz', RegExp.rightContext);
    33 // 'abc123xyz'.match(/abc123xyz/); RegExp.rightContext
    34 'abc123xyz'.match(/abc123xyz/);
    35 new TestCase ( SECTION, "'abc123xyz'.match(/abc123xyz/); RegExp.rightContext",
    36 	       '', RegExp.rightContext);
    38 // 'xxxx'.match(/$/); RegExp.rightContext
    39 'xxxx'.match(/$/);
    40 new TestCase ( SECTION, "'xxxx'.match(/$/); RegExp.rightContext",
    41 	       '', RegExp.rightContext);
    43 // 'test'.match(/^/); RegExp.rightContext
    44 'test'.match(/^/);
    45 new TestCase ( SECTION, "'test'.match(/^/); RegExp.rightContext",
    46 	       'test', RegExp.rightContext);
    48 // 'xxxx'.match(new RegExp('$')); RegExp.rightContext
    49 'xxxx'.match(new RegExp('$'));
    50 new TestCase ( SECTION, "'xxxx'.match(new RegExp('$')); RegExp.rightContext",
    51 	       '', RegExp.rightContext);
    53 // 'test'.match(new RegExp('^')); RegExp.rightContext
    54 'test'.match(new RegExp('^'));
    55 new TestCase ( SECTION, "'test'.match(new RegExp('^')); RegExp.rightContext",
    56 	       'test', RegExp.rightContext);
    58 test();

mercurial