js/src/tests/js1_2/regexp/string_split.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 // |reftest| skip -- obsolete test
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     8 /**
     9    Filename:     string_split.js
    10    Description:  'Tests the split method on Strings using regular expressions'
    12    Author:       Nick Lerissa
    13    Date:         March 11, 1998
    14 */
    16 var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
    17 var VERSION = 'no version';
    18 startTest();
    19 var TITLE   = 'String: split';
    21 writeHeaderToLog('Executing script: string_split.js');
    22 writeHeaderToLog( SECTION + " "+ TITLE);
    25 // 'a b c de f'.split(/\s/)
    26 new TestCase ( SECTION, "'a b c de f'.split(/\s/)",
    27 	       String(["a","b","c","de","f"]), String('a b c de f'.split(/\s/)));
    29 // 'a b c de f'.split(/\s/,3)
    30 new TestCase ( SECTION, "'a b c de f'.split(/\s/,3)",
    31 	       String(["a","b","c"]), String('a b c de f'.split(/\s/,3)));
    33 // 'a b c de f'.split(/X/)
    34 new TestCase ( SECTION, "'a b c de f'.split(/X/)",
    35 	       String(["a b c de f"]), String('a b c de f'.split(/X/)));
    37 // 'dfe23iu 34 =+65--'.split(/\d+/)
    38 new TestCase ( SECTION, "'dfe23iu 34 =+65--'.split(/\d+/)",
    39 	       String(["dfe","iu "," =+","--"]), String('dfe23iu 34 =+65--'.split(/\d+/)));
    41 // 'dfe23iu 34 =+65--'.split(new RegExp('\d+'))
    42 new TestCase ( SECTION, "'dfe23iu 34 =+65--'.split(new RegExp('\\d+'))",
    43 	       String(["dfe","iu "," =+","--"]), String('dfe23iu 34 =+65--'.split(new RegExp('\\d+'))));
    45 // 'abc'.split(/[a-z]/)
    46 new TestCase ( SECTION, "'abc'.split(/[a-z]/)",
    47 	       String(["","",""]), String('abc'.split(/[a-z]/)));
    49 // 'abc'.split(/[a-z]/)
    50 new TestCase ( SECTION, "'abc'.split(/[a-z]/)",
    51 	       String(["","",""]), String('abc'.split(/[a-z]/)));
    53 // 'abc'.split(new RegExp('[a-z]'))
    54 new TestCase ( SECTION, "'abc'.split(new RegExp('[a-z]'))",
    55 	       String(["","",""]), String('abc'.split(new RegExp('[a-z]'))));
    57 // 'abc'.split(new RegExp('[a-z]'))
    58 new TestCase ( SECTION, "'abc'.split(new RegExp('[a-z]'))",
    59 	       String(["","",""]), String('abc'.split(new RegExp('[a-z]'))));
    61 test();

mercurial