Github user Tibor17 commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/113#discussion_r64666590
  
    --- Diff: 
surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
 ---
    @@ -479,6 +481,27 @@ else if ( hasMethod )
                 updatedFilters( isExcluded, test, patterns, includedFilters, 
excludedFilters );
             }
         }
    +    
    +    private static void regexSanityCheck( String request, String 
classNameExpr, String methodNameExpr )
    +    {
    +        // this will emit any exception if the regex is not valid at all
    +        Pattern.compile( request );
    +        try
    +        {
    +            Pattern.compile( classNameExpr );
    +            Pattern.compile( methodNameExpr );
    +            if ( methodNameExpr.indexOf( "#" ) != -1 )
    --- End diff --
    
    I thought you would use `String.contains` in both constructors of 
`ResolvedTest`.
    I think we do not need to use `Pattern.compile` here because this is 
already done by `maven-shared-utils` anyway.
    Lets use the sanity check if the `isRegex` is set, because I do not know 
how Cucumber would use JUnit Description of method or class name without regex. 
Cucumber is different runner from most of the other.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to