-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with test method parameters of type String containing newline #41
Comments
How do you execute the test? Which Java and which JUnit version do you use? I cannot reproduce the problem. It works for me in Eclipse and the gradle test runner with Java 1.7 and JUnit 4.8.2. |
Hi @g-fresh, hi @janschaefer, I cannot reproduce the What I can imagine to avoid this is adding a special formatting for Using |
I just reconsidered may former comment about IntelliJ IDEA and saw that I made a mistake. Actually there is no problem with IntelliJ and newlines character in test method descriptions (=> delete the former post with the stacktrace ...) |
Hi @g-fresh, I just tried to reproduce your bug again but still no sucess.
Furthermore, in every version between v1.4.0 and v1.7.0 I can reproduce your reported bug for the included test containing the newline character. It is thrown because the filter description does not match the corresponding pattern (which is rather logical as it contains a newline and the matcher does not recognize newlines with With #42 and the replacement of newlines with their printable companion, this would be no longer necessary to fix, but I think it is worth to fix. |
* master: prepared next development version, v1.9.4-SNAPSHOT prepared release for v1.9.3 fixed findbugsMain task for Java < v1.7 added test for JDK 8 by travis.ci improvements of build.gradle and javadoc fixed filter pattern to also match newlines (using Pattern.DOTALL) (#41) Class-Name in generous pattern must have only valid java identifier added acceptance test to use newlines with dataprovider added defaults of @dataProvider properties to javadoc fixed #42 (JUnit cannot deal with newlines in test method parameters)
In version 1.9.2, using data a provider which produces strings containing newline, results in strange behavior.
Exampe:
Running the method separately (not the complete test case), you get:
Without the last parameter ("\n"), things work as expected.
Running the complete test case from the console, everythings works as expected.
Running the complete test case from Eclipse, you don't get any test results, meaning:
The JUnit view shows the list of tests, but reports 0/4 runs.
The text was updated successfully, but these errors were encountered: