From b42c0eab503c7abfdc8efb3e2efe9ef1dce71e14 Mon Sep 17 00:00:00 2001 From: "rogerl%netscape.com" Date: Tue, 4 Jun 2002 18:51:05 +0000 Subject: [PATCH] Corrected tests to match ECMA - unmatched paren contents need to have the value 'undefined' rather than an empty string. --- js/tests/ecma_2/String/match-002.js | 12 ++++++------ js/tests/ecma_3/RegExp/regress-31316.js | 2 +- js/tests/ecma_3/RegExp/regress-57572.js | 2 +- js/tests/ecma_3/RegExp/regress-87231.js | 4 ++-- js/tests/js1_2/regexp/vertical_bar.js | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/js/tests/ecma_2/String/match-002.js b/js/tests/ecma_2/String/match-002.js index 2e5ac8254a3..83ac2fa4bde 100644 --- a/js/tests/ecma_2/String/match-002.js +++ b/js/tests/ecma_2/String/match-002.js @@ -46,12 +46,12 @@ "/([\d]{5})([-\ ]?[\d]{4})?$/", "Boston, Mass. 02134", 14, - ["02134", "02134"]); + ["02134", "02134", undefined]); AddGlobalRegExpCases( /([\d]{5})([-\ ]?[\d]{4})?$/g, "/([\d]{5})([-\ ]?[\d]{4})?$/g", "Boston, Mass. 02134", - ["02134", ]); + ["02134"]); // set the value of lastIndex re = /([\d]{5})([-\ ]?[\d]{4})?$/; @@ -63,7 +63,7 @@ "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex =0", s, s.lastIndexOf("0"), - ["02134", "02134"]); + ["02134", "02134", undefined]); re.lastIndex = s.length; @@ -73,7 +73,7 @@ s.length, s, s.lastIndexOf("0"), - ["02134", "02134"] ); + ["02134", "02134", undefined] ); re.lastIndex = s.lastIndexOf("0"); @@ -82,7 +82,7 @@ s.lastIndexOf("0"), s, s.lastIndexOf("0"), - ["02134", "02134"]); + ["02134", "02134", undefined]); re.lastIndex = s.lastIndexOf("0") + 1; @@ -91,7 +91,7 @@ s.lastIndexOf("0") +1, s, s.lastIndexOf("0"), - ["02134", "02134"]); + ["02134", "02134", undefined]); test(); diff --git a/js/tests/ecma_3/RegExp/regress-31316.js b/js/tests/ecma_3/RegExp/regress-31316.js index 350ef1afd92..b68e42a9503 100644 --- a/js/tests/ecma_3/RegExp/regress-31316.js +++ b/js/tests/ecma_3/RegExp/regress-31316.js @@ -45,7 +45,7 @@ status = inSection(1); pattern = /<([^\/<>][^<>]*[^\/])>|<([^\/<>])>/; string = '

Some
test

'; actualmatch = string.match(pattern); -expectedmatch = Array('

', cnEmptyString, 'p'); +expectedmatch = Array('

', undefined, 'p'); addThis(); diff --git a/js/tests/ecma_3/RegExp/regress-57572.js b/js/tests/ecma_3/RegExp/regress-57572.js index 8b766e4f309..c4842af16d6 100644 --- a/js/tests/ecma_3/RegExp/regress-57572.js +++ b/js/tests/ecma_3/RegExp/regress-57572.js @@ -59,7 +59,7 @@ status = inSection(3); pattern = /(\S+)????(.*)/; string= 'Test this'; actualmatch = string.match(pattern); -expectedmatch = Array(string, cnEmptyString, string); +expectedmatch = Array(string, undefined, string); addThis(); status = inSection(4); diff --git a/js/tests/ecma_3/RegExp/regress-87231.js b/js/tests/ecma_3/RegExp/regress-87231.js index 03ad8edc80b..7fde4ff2f64 100644 --- a/js/tests/ecma_3/RegExp/regress-87231.js +++ b/js/tests/ecma_3/RegExp/regress-87231.js @@ -69,7 +69,7 @@ pattern = /^(A)?(A.*)$/; status = inSection(3); string = 'A'; actualmatch = string.match(pattern); - expectedmatch = Array('A', cnEmptyString, 'A'); // 'altruistic' case: see above + expectedmatch = Array('A', undefined, 'A'); // 'altruistic' case: see above addThis(); @@ -92,7 +92,7 @@ var strR = 'aaAAaaaf;lrlrzs'; status = inSection(6); string = strL + 'A' + strR; actualmatch = string.match(pattern); - expectedmatch = Array('A' + strR, cnEmptyString, 'A' + strR); // 'altruistic' case: see above + expectedmatch = Array('A' + strR, undefined, 'A' + strR); // 'altruistic' case: see above addThis(); diff --git a/js/tests/js1_2/regexp/vertical_bar.js b/js/tests/js1_2/regexp/vertical_bar.js index f45b5f1acc7..39b428ad75f 100644 --- a/js/tests/js1_2/regexp/vertical_bar.js +++ b/js/tests/js1_2/regexp/vertical_bar.js @@ -64,7 +64,7 @@ // 'Hi Bob'.match(new RegExp('(Rob)|(Bob)|(Robert)|(Bobby)')) testcases[count++] = new TestCase ( SECTION, "'Hi Bob'.match(new RegExp('(Rob)|(Bob)|(Robert)|(Bobby)'))", - String(["Bob","","Bob"]), String('Hi Bob'.match(new RegExp('(Rob)|(Bob)|(Robert)|(Bobby)')))); + String(["Bob",undefined,"Bob", undefined, undefined]), String('Hi Bob'.match(new RegExp('(Rob)|(Bob)|(Robert)|(Bobby)')))); // 'abcdef'.match(new RegExp('abc|bcd|cde|def')) testcases[count++] = new TestCase ( SECTION, "'abcdef'.match(new RegExp('abc|bcd|cde|def'))", @@ -72,7 +72,7 @@ // 'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/) testcases[count++] = new TestCase ( SECTION, "'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/)", - String(["Bob","","Bob"]), String('Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/))); + String(["Bob",undefined,"Bob", undefined, undefined]), String('Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/))); // 'abcdef'.match(/abc|bcd|cde|def/) testcases[count++] = new TestCase ( SECTION, "'abcdef'.match(/abc|bcd|cde|def/)",