shivadorepally / junitparams

Automatically exported from code.google.com/p/junitparams
0 stars 0 forks source link

Unexpected behavior when passing strings with "newline" characters #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
First of all thank you for providing junitparams which makes parameterized 
tests a lot easier with junit !

What steps will reproduce the problem?
1. Create a simple Test with one test method and one provider method (see below)
2. In the provider method create one variable with newline characters (eg 
System.getProperty("line.separator")). See code sample below
3. Run the test case.

What is the expected output? What do you see instead?
I expect the test to run,  but nothing happens.

What version of the product are you using? On what operating system?
JUnitParams-0.3.0.jar + eclipse helios + win 7 64 bit.

Please provide any additional information below.

@RunWith(JUnitParamsRunner.class)
public class DummyTest
{
    @Test
    @Parameters(method = "dummyProvider")
    public void dummyTest(String dummy)
    {
        assertThat("fake", is(dummy));
    }

    static Object[] dummyProvider()
    {
        String someParam = "dummy" + System.getProperty("line.separator") ;
        return new Object [] {
                new Object[] {someParam}
        } ;
    }
}

Original issue reported on code.google.com by mickael....@gmail.com on 8 Sep 2011 at 12:16

GoogleCodeExporter commented 8 years ago
Please check with JUnitParams-0.3.5
Works for me...

Original comment by lipinski...@gmail.com on 17 Nov 2011 at 8:52