public class RotatableMatrixTest
{
+ private static final String NL = System.lineSeparator();
+
private RotatableMatrix rm;
@BeforeMethod(alwaysRun = true)
@Test(groups = "Functional")
public void testPrint()
{
- String expected = "0.5 1.0 1.5\n1.0 2.0 3.0\n1.5 3.0 4.5\n";
+ String expected = "0.5 1.0 1.5" + NL + "1.0 2.0 3.0" + NL
+ + "1.5 3.0 4.5" + NL;
ByteArrayOutputStream os = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(os, true);
rm.print(ps);
String result = new String(os.toByteArray());
- assertEquals(result.replaceAll("\r", ""), expected);
+ assertEquals(result, expected);
}
@Test(groups = "Functional")