moonchen commented on code in PR #13441:
URL: https://github.com/apache/trafficserver/pull/13441#discussion_r3751160474


##########
src/tsutil/unit_tests/test_Regex.cc:
##########
@@ -460,6 +460,23 @@ TEST_CASE("RegexMatches edge cases", 
"[libts][Regex][RegexMatches]")
     CHECK(count >= 2); // At least whole match + first group
     CHECK(matches[1] == "foo");
   }
+
+  SECTION("RegexMatches with a non-participating group before a participating 
one")
+  {
+    // pcre2_match() returns one past the highest participating group, so an 
earlier optional group
+    // that did not participate is still within that count. Its offsets are 
unset.
+    Regex r;
+    REQUIRE(r.compile("(a)?(b)") == true);

Review Comment:
   Keeping `== true` for consistency with the rest of the file, which uses it 
110 times and the bare form zero times. Dropping it here would make this the 
only section that differs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to