[PATCH 0/1] MR10812: vbscript/tests: Cover bare match.SubMatches(N) indexing.
Existing regexp.vbs tests only access submatches via the split form (Set submatch = match.SubMatches; submatch.Item(N)) or the chained-call form match.SubMatches()(N). The bare property-then-index form match.SubMatches(N) was untested. Add two assertions on a known pattern to lock in the current behavior. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10812
From: Francis De Brabandere <francisdb@gmail.com> Existing regexp.vbs tests only access submatches via the split form (Set submatch = match.SubMatches; submatch.Item(N)) or the chained-call form match.SubMatches()(N). The bare property-then-index form match.SubMatches(N) was untested. Add two assertions on a known pattern to lock in the current behavior. --- dlls/vbscript/tests/regexp.vbs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/vbscript/tests/regexp.vbs b/dlls/vbscript/tests/regexp.vbs index 6569b98956e..1a6a4aeb0dc 100644 --- a/dlls/vbscript/tests/regexp.vbs +++ b/dlls/vbscript/tests/regexp.vbs @@ -167,6 +167,11 @@ Set submatch = match.SubMatches Call ok(submatch.Count = 2, "submatch.Count = " & submatch.Count) Call ok(submatch.Item(0) = "a", "submatch.Item(0) = " & submatch.Item(0)) Call ok(submatch.Item(1) = "b", "submatch.Item(0) = " & submatch.Item(1)) +' Bare property-then-index form: match.SubMatches(N) parses as a single +' index expression on the SubMatches collection, distinct from the +' chained-call form match.SubMatches()(N). +Call ok(match.SubMatches(0) = "a", "match.SubMatches(0) = " & match.SubMatches(0)) +Call ok(match.SubMatches(1) = "b", "match.SubMatches(1) = " & match.SubMatches(1)) Set x = new regexp Call ok(x.Pattern = "", "RegExp.Pattern = " & x.Pattern) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10812
This merge request was approved by Jacek Caban. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10812
participants (3)
-
Francis De Brabandere -
Francis De Brabandere (@francisdb) -
Jacek Caban (@jacek)