From d7d02aedca8936232f6216a3d5e47a8037d8a188 Mon Sep 17 00:00:00 2001 From: tannal Date: Fri, 4 Oct 2024 14:13:23 +0800 Subject: [PATCH] fix errors --- .../RegExp/prototype/exec/regexp-builtin-exec-v-u-flag.js | 4 ++-- .../prototype/match/regexp-prototype-match-v-u-flag.js | 2 +- .../matchAll/regexp-prototype-matchAll-v-u-flag.js | 6 +++--- .../prototype/replace/regexp-prototype-replace-v-u-flag.js | 2 -- .../prototype/search/regexp-prototype-search-v-u-flag.js.js | 1 - 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/test/built-ins/RegExp/prototype/exec/regexp-builtin-exec-v-u-flag.js b/test/built-ins/RegExp/prototype/exec/regexp-builtin-exec-v-u-flag.js index d77df4b733..b22547e7a6 100644 --- a/test/built-ins/RegExp/prototype/exec/regexp-builtin-exec-v-u-flag.js +++ b/test/built-ins/RegExp/prototype/exec/regexp-builtin-exec-v-u-flag.js @@ -14,6 +14,8 @@ function doExec(regex) { return result ? [result[0], result.index] : null; } +assert.compareArray(doExec(/𠮷/), ["𠮷", 0], "Basic exec without v flag"); + assert.compareArray(doExec(/𠮷/u), ["𠮷", 0], "Exec with u flag"); assert.compareArray(doExec(/\p{Script=Han}/u), ["𠮷", 0], "Unicode property escapes with u flag"); assert.compareArray(doExec(/./u), ["𠮷", 0], "Dot with u flag"); @@ -43,5 +45,3 @@ assert.sameValue(resultWithGroupsV.index, 0, "Match index for groups with v flag const complexText = 'a\u{20BB7}b\u{10FFFF}c'; assert.compareArray(/\P{ASCII}/u.exec(complexText), ["\u{20BB7}"], "Non-ASCII with u flag"); assert.compareArray(/\P{ASCII}/v.exec(complexText), ["\u{20BB7}"], "Non-ASCII with v flag"); - -reportCompare(0, 0); diff --git a/test/built-ins/String/prototype/match/regexp-prototype-match-v-u-flag.js b/test/built-ins/String/prototype/match/regexp-prototype-match-v-u-flag.js index acac5c7fbc..4b318cf3e8 100644 --- a/test/built-ins/String/prototype/match/regexp-prototype-match-v-u-flag.js +++ b/test/built-ins/String/prototype/match/regexp-prototype-match-v-u-flag.js @@ -29,4 +29,4 @@ assert.compareArray(doMatch(/[👨‍👩‍👧‍👦]/u), ["👨"], "Complex assert.sameValue(doMatch(/x/u), null, "Non-matching regex with u flag"); assert.sameValue(doMatch(/x/v), null, "Non-matching regex with v flag"); -reportCompare(0, 0); + diff --git a/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-v-u-flag.js b/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-v-u-flag.js index 6a70f7f137..6561c6c0c7 100644 --- a/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-v-u-flag.js +++ b/test/built-ins/String/prototype/matchAll/regexp-prototype-matchAll-v-u-flag.js @@ -4,6 +4,7 @@ esid: sec-regexp.prototype-@@matchall description: RegExp.prototype[@@matchAll] behavior with 'u'and 'v' flags. features: [Symbol.matchAll, regexp-v-flag, regexp-unicode-property-escapes] +includes: [compareArray.js] ---*/ const text = '𠮷a𠮷b𠮷'; @@ -59,13 +60,13 @@ assert.sameValue( assert.sameValue( doMatchAll(/(?:)/gu).length, - 6, + 12, "Empty matches with u flag" ); assert.sameValue( doMatchAll(/(?:)/gv).length, - 6, + 12, "Empty matches with v flag" ); @@ -80,4 +81,3 @@ assert.sameValue( undefined, "Non-ASCII with v flag" ); -reportCompare(0, 0); diff --git a/test/built-ins/String/prototype/replace/regexp-prototype-replace-v-u-flag.js b/test/built-ins/String/prototype/replace/regexp-prototype-replace-v-u-flag.js index 92b2fd5d75..58f924ee7b 100644 --- a/test/built-ins/String/prototype/replace/regexp-prototype-replace-v-u-flag.js +++ b/test/built-ins/String/prototype/replace/regexp-prototype-replace-v-u-flag.js @@ -24,5 +24,3 @@ assert.sameValue( assert.sameValue(doReplace(/\p{Script=Han}/gu, 'X'), "XaXbX", "Unicode property escapes with u flag"); assert.sameValue(doReplace(/\p{Script=Han}/gv, 'X'), "XaXbX", "Unicode property escapes with v flag"); - -reportCompare(0, 0); diff --git a/test/built-ins/String/prototype/search/regexp-prototype-search-v-u-flag.js.js b/test/built-ins/String/prototype/search/regexp-prototype-search-v-u-flag.js.js index aa31cead82..4365636058 100644 --- a/test/built-ins/String/prototype/search/regexp-prototype-search-v-u-flag.js.js +++ b/test/built-ins/String/prototype/search/regexp-prototype-search-v-u-flag.js.js @@ -41,4 +41,3 @@ assert.sameValue(doSearch(/[👨‍👩‍👧‍👦]/u), 9, "Complex emoji seq // Non-existent pattern assert.sameValue(doSearch(/x/u), -1, "Search for non-existent pattern with u flag"); assert.sameValue(doSearch(/x/v), -1, "Search for non-existent pattern with v flag"); -reportCompare(0, 0);