bturner commented on a change in pull request #138: SUREFIRE-1309: Clarifying
use of regular expressions for inclusion/exclusion
URL: https://github.com/apache/maven-surefire/pull/138#discussion_r232853437
##########
File path:
maven-surefire-plugin/src/site/apt/examples/inclusion-exclusion.apt.vm
##########
@@ -164,7 +164,16 @@ Inclusions and Exclusions of Tests
+---+
Note the syntax <<<%regex[expr]>>>, where <<<expr>>> is the actual
expression and the rest is just wrapping. Also
- note that regex matches are done over <<<*.class>>> files and not
<<<*.java>>> files.
+ note the following about the use of regular expressions:
+
+ * Regex matches are done over <<<*.class>>> files and not <<<*.java>>> files
+
+ * Regex matches are done over paths using slashes ("<<</>>>") and not
package names using dots ("<<<.>>>"), so the
+ "<<<.>>>" in <<<pkg.*Slow.*.class>>> is a regex metacharacter, which
happens to match any character, notably
+ the (forward) slashes ("<<</>>>") that make up the path. Slashes here
are <forward>, even on Windows
Review comment:
This is not true, at least in Surefire 2.22.0 and 2.22.1. Perhaps it's a
regression, but I've found I have to use an exclude pattern like
`%regex[it[/\\\\].*]` in order for it to work on Windows and !Windows. If I do
`%regex[it/.*]` then tests like `it.com.example.IntegrationTest` are not run,
but on Windows they _are_ run.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services