js/src/tests/js1_2/regexp/control_characters.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_2/regexp/control_characters.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +
    1.10 +/**
    1.11 +   Filename:     control_characters.js
    1.12 +   Description:  'Tests regular expressions containing .'
    1.13 +
    1.14 +   Author:       Nick Lerissa
    1.15 +   Date:         April 8, 1998
    1.16 +*/
    1.17 +
    1.18 +var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
    1.19 +var VERSION = 'no version';
    1.20 +var TITLE = 'RegExp: .';
    1.21 +var BUGNUMBER="123802";
    1.22 +
    1.23 +startTest();
    1.24 +writeHeaderToLog('Executing script: control_characters.js');
    1.25 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.26 +
    1.27 +
    1.28 +// 'àOÐ ê:i¢Ø'.match(new RegExp('.+'))
    1.29 +new TestCase ( SECTION, "'àOÐ ê:i¢Ø'.match(new RegExp('.+'))",
    1.30 +	       String(['àOÐ ê:i¢Ø']), String('àOÐ ê:i¢Ø'.match(new RegExp('.+'))));
    1.31 +
    1.32 +// string1.match(new RegExp(string1))
    1.33 +var string1 = 'àOÐ ê:i¢Ø';
    1.34 +new TestCase ( SECTION, "string1 = " + string1 + " string1.match(string1)",
    1.35 +	       String([string1]), String(string1.match(string1)));
    1.36 +
    1.37 +string1 = "";
    1.38 +for (var i = 0; i < 32; i++)
    1.39 +  string1 += String.fromCharCode(i);
    1.40 +new TestCase ( SECTION, "string1 = " + string1 + " string1.match(string1)",
    1.41 +	       String([string1]), String(string1.match(string1)));
    1.42 +
    1.43 +test();

mercurial