Debian Codegraph @

rhino/testsrc/tests/js1_2/regexp/RegExp_rightContext.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 = 'RegExp_rightContext.js';
7
8 /**
9 Filename: RegExp_rightContext.js
10 Description: 'Tests RegExps rightContext property'
11
12 Author: Nick Lerissa
13 Date: March 12, 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: rightContext';
20
21 writeHeaderToLog('Executing script: RegExp_rightContext.js');
22 writeHeaderToLog( SECTION + " "+ TITLE);
23
24 // 'abc123xyz'.match(/123/); RegExp.rightContext
25 'abc123xyz'.match(/123/);
26 new TestCase ( SECTION, "'abc123xyz'.match(/123/); RegExp.rightContext",
27 'xyz', RegExp.rightContext);
28
29 // 'abc123xyz'.match(/456/); RegExp.rightContext
30 'abc123xyz'.match(/456/);
31 new TestCase ( SECTION, "'abc123xyz'.match(/456/); RegExp.rightContext",
32 'xyz', RegExp.rightContext);
33
34 // 'abc123xyz'.match(/abc123xyz/); RegExp.rightContext
35 'abc123xyz'.match(/abc123xyz/);
36 new TestCase ( SECTION, "'abc123xyz'.match(/abc123xyz/); RegExp.rightContext",
37 '', RegExp.rightContext);
38
39 // 'xxxx'.match(/$/); RegExp.rightContext
40 'xxxx'.match(/$/);
41 new TestCase ( SECTION, "'xxxx'.match(/$/); RegExp.rightContext",
42 '', RegExp.rightContext);
43
44 // 'test'.match(/^/); RegExp.rightContext
45 'test'.match(/^/);
46 new TestCase ( SECTION, "'test'.match(/^/); RegExp.rightContext",
47 'test', RegExp.rightContext);
48
49 // 'xxxx'.match(new RegExp('$')); RegExp.rightContext
50 'xxxx'.match(new RegExp('$'));
51 new TestCase ( SECTION, "'xxxx'.match(new RegExp('$')); RegExp.rightContext",
52 '', RegExp.rightContext);
53
54 // 'test'.match(new RegExp('^')); RegExp.rightContext
55 'test'.match(new RegExp('^'));
56 new TestCase ( SECTION, "'test'.match(new RegExp('^')); RegExp.rightContext",
57 'test', RegExp.rightContext);
58
59 test();