Debian Codegraph @

rhino/testsrc/tests/js1_2/regexp/toString.js

raw symbols SCIP
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 gTestfile = 'toString.js';
7
8 /**
9 Filename: toString.js
10 Description: 'Tests RegExp method toString'
11
12 Author: Nick Lerissa
13 Date: March 13, 1998
14 */
15
16 var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
17 var VERSION = 'no version';
18 startTest();
19 var TITLE = 'RegExp: toString';
20
21 writeHeaderToLog('Executing script: toString.js');
22 writeHeaderToLog( SECTION + " "+ TITLE);
23
24
25 /*
26 * var re = new RegExp(); re.toString() For what to expect,
27 * see http://bugzilla.mozilla.org/show_bug.cgi?id=225343#c7
28 */
29 var re = new RegExp();
30 new TestCase ( SECTION, "var re = new RegExp(); re.toString()",
31 '/(?:)/', re.toString());
32
33 // re = /.+/; re.toString();
34 re = /.+/;
35 new TestCase ( SECTION, "re = /.+/; re.toString()",
36 '/.+/', re.toString());
37
38 // re = /test/gi; re.toString()
39 re = /test/gi;
40 new TestCase ( SECTION, "re = /test/gi; re.toString()",
41 '/test/gi', re.toString());
42
43 // re = /test2/ig; re.toString()
44 re = /test2/ig;
45 new TestCase ( SECTION, "re = /test2/ig; re.toString()",
46 '/test2/gi', re.toString());
47
48 test();