Merge branch '6.2.x'

This commit is contained in:
Brian Clozel
2025-11-05 18:36:15 +01:00
5 changed files with 10 additions and 27 deletions
@@ -232,7 +232,6 @@ class PathPatternParserTests {
checkError("/{abc}{*foobar}", 1, PatternMessage.CAPTURE_ALL_IS_STANDALONE_CONSTRUCT);
checkError("/{abc}{*foobar}{foo}", 1, PatternMessage.CAPTURE_ALL_IS_STANDALONE_CONSTRUCT);
checkError("/{*foo}/foo/{*bar}", 18, PatternMessage.CANNOT_HAVE_MANY_MULTISEGMENT_PATHELEMENTS);
checkError("/{*foo}/{bar}", 8, PatternMessage.MULTISEGMENT_PATHELEMENT_NOT_FOLLOWED_BY_LITERAL);
checkError("{foo:}", 5, PatternMessage.MISSING_REGEX_CONSTRAINT);
checkError("{foo}_{foo}", 0, PatternMessage.ILLEGAL_DOUBLE_CAPTURE, "foo");
checkError("/{bar}/{bar}", 7, PatternMessage.ILLEGAL_DOUBLE_CAPTURE, "bar");
@@ -185,6 +185,16 @@ class PathPatternTests {
checkMatches("/resource/**", "/resource/foobar");
}
@Test
void wildcardSegmentsThenNonLiteral() {
checkMatches("/**/*.js", "/script.js");
checkMatches("/**/*.js", "/js/script.js");
checkMatches("/**/*.js", "/files/js/script.js");
checkMatches("/**/{type}/*.js", "/files/js/script.js");
checkNoMatch("/**/*.js", "/files/style.css");
}
@Test
void antPathMatcherTests() {
// test exact matching