js/src/tests/js1_2/regexp/toString.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:1fd239506c50
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/. */
5
6
7 /**
8 Filename: toString.js
9 Description: 'Tests RegExp method toString'
10
11 Author: Nick Lerissa
12 Date: March 13, 1998
13 */
14
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: toString';
19
20 writeHeaderToLog('Executing script: toString.js');
21 writeHeaderToLog( SECTION + " "+ TITLE);
22
23
24 /*
25 * var re = new RegExp(); re.toString() For what to expect,
26 * see http://bugzilla.mozilla.org/show_bug.cgi?id=225343#c7
27 */
28 var re = new RegExp();
29 new TestCase ( SECTION, "var re = new RegExp(); re.toString()",
30 '/(?:)/', re.toString());
31
32 // re = /.+/; re.toString();
33 re = /.+/;
34 new TestCase ( SECTION, "re = /.+/; re.toString()",
35 '/.+/', re.toString());
36
37 // re = /test/gi; re.toString()
38 re = /test/gi;
39 new TestCase ( SECTION, "re = /test/gi; re.toString()",
40 '/test/gi', re.toString());
41
42 // re = /test2/ig; re.toString()
43 re = /test2/ig;
44 new TestCase ( SECTION, "re = /test2/ig; re.toString()",
45 '/test2/gi', re.toString());
46
47 test();

mercurial