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/. */
8
* File Name: RegExp/octal-001.js
10
* Description: Based on ECMA 2 Draft 7 February 1999
11
* Simple test cases for matching OctalEscapeSequences.
12
* Author: christine@netscape.com
13
* Date: 19 February 1999
15
var SECTION = "RegExp/octal-001.js";
16
var VERSION = "ECMA_2";
17
var TITLE = "RegExp patterns that contain OctalEscapeSequences";
18
var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346196";
34
function AddRegExpCases(
35
regexp, str_regexp, pattern, str_pattern, index, matches_array ) {
37
// prevent a runtime error
39
if ( regexp.exec(pattern) == null || matches_array == null ) {
41
regexp + ".exec(" + str_pattern +")",
43
regexp.exec(pattern) );
48
str_regexp + ".exec(" + str_pattern +").length",
50
regexp.exec(pattern).length );
53
str_regexp + ".exec(" + str_pattern +").index",
55
regexp.exec(pattern).index );
58
str_regexp + ".exec(" + str_pattern +").input",
60
regexp.exec(pattern).input );
63
str_regexp + ".exec(" + str_pattern +").toString()",
64
matches_array.toString(),
65
regexp.exec(pattern).toString() );
67
var limit = matches_array.length > regexp.exec(pattern).length
68
? matches_array.length
69
: regexp.exec(pattern).length;
71
for ( var matches = 0; matches < limit; matches++ ) {
73
str_regexp + ".exec(" + str_pattern +")[" + matches +"]",
74
matches_array[matches],
75
regexp.exec(pattern)[matches] );