1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-14 11:29:26 +01:00

Fix CommandLineTest.testCommandLineVersion() on Windows

Fix CommandLineTest.testCommandLineVersion() failing on Windows due to Runtime.exec() returning `\r\n` line endings where the test expected `\n` line endings.
This commit is contained in:
Pieter12345 2019-03-22 02:13:01 +01:00 committed by Cristian Maglie
parent 442007a926
commit 933bbb3a39

View File

@ -139,10 +139,10 @@ public class CommandLineTest {
pr.waitFor(); pr.waitFor();
Assertions.assertThat(pr.exitValue()) Assertions.assertThat(pr.exitValue())
.as("Process will finish with exit code 0 in --version") .as("Process will finish with exit code 0 in --version")
.isEqualTo(0); .isEqualTo(0);
Assertions.assertThat(new String(IOUtils.toByteArray(pr.getInputStream()))) Assertions.assertThat(new String(IOUtils.toByteArray(pr.getInputStream())))
.matches("Arduino: \\d+\\.\\d+\\.\\d+.*\n"); .matches("Arduino: \\d+\\.\\d+\\.\\d+.*\r?\n");
} }
@Test @Test
@ -156,7 +156,7 @@ public class CommandLineTest {
pr.waitFor(); pr.waitFor();
Assertions.assertThat(pr.exitValue()) Assertions.assertThat(pr.exitValue())
.as("Multiple Action will be rejected") .as("Multiple Action will be rejected")
.isEqualTo(3); .isEqualTo(3);
} }
} }