[ 
https://issues.apache.org/jira/browse/SUREFIRE-1250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15298852#comment-15298852
 ] 

ASF GitHub Bot commented on SUREFIRE-1250:
------------------------------------------

GitHub user kgyrtkirk opened a pull request:

    https://github.com/apache/maven-surefire/pull/113

    SUREFIRE-1250: add exceptions to describe usage rules of %regex

    @Tibor17 i've cleaned it up a bit; and added exception for multiple 
hashmarks too. tests have passed on my machine.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kgyrtkirk/maven-surefire SUREFIRE-1250

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven-surefire/pull/113.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #113
    
----
commit 09e33b88e82266a3118b9db260496f30a8861e58
Author: Haindrich Zoltán (kirk) <[email protected]>
Date:   2016-05-24T20:28:11Z

    SUREFIRE-1250: add exceptions to describe usage rules of %regex

----


> Regex testcase filtering: exception when hashmark is regex-quoted
> -----------------------------------------------------------------
>
>                 Key: SUREFIRE-1250
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1250
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.19.1
>            Reporter: Zoltan Haindrich
>            Assignee: Tibor Digana
>            Priority: Minor
>         Attachments: SUREFIRE-1250.patch
>
>
> i've been using regex to select which tests to run...and i've got some wierd 
> exceptions when executing
> {code}
> mvn test "-Dtest=%regex[.*\Q#\E.*]"
> {code}
> executing the above command results in:
> {code}
> java.util.regex.PatternSyntaxException: 
> Illegal/unsupported escape sequence near index 1
> \E.*
>  ^
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:364)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
> {code}
> i noticed earlier that maven might do some black-magic with these regexps in 
> the background ( i know that it should know the class name earlier; to avoid 
> starting testcases which will get entirely excluded...and thats cool )
> ...so..i assume maven does split the regex by the {{#}}; and that's okay - if 
> that can't be avoided; place some pointers in the documentation about it 
> and/or a more descriptive exception could be useful



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to