mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Handle cli-output_windows.txt with CRLF line endings
On Windows, it is likely that cli-output_windows.txt will have CRLF line endings since core.autocrlf is normally true which converts LF endings to CRLF on checkout. This causes BisqHelpFormatterTest to fail since the actual content it is compared against uses LF endings. As a result, when loading the cli-output_windows.txt file normalize line endings to LF.
This commit is contained in:
parent
de54518839
commit
f3799187cc
1 changed files with 4 additions and 1 deletions
|
@ -125,7 +125,10 @@ public class BisqHelpFormatterTest {
|
|||
ByteArrayOutputStream actual = new ByteArrayOutputStream();
|
||||
String expected = new String(Files.readAllBytes(Paths.get(getClass().getResource("cli-output.txt").toURI())));
|
||||
if (System.getProperty("os.name").startsWith("Windows")) {
|
||||
expected = new String(Files.readAllBytes(Paths.get(getClass().getResource("cli-output_windows.txt").toURI())));
|
||||
// Load the expected content from a different file for Windows due to different path separator
|
||||
// And normalize line endings to LF in case the file has CRLF line endings
|
||||
expected = new String(Files.readAllBytes(Paths.get(getClass().getResource("cli-output_windows.txt").toURI())))
|
||||
.replaceAll("\\r\\n?", "\n");
|
||||
}
|
||||
|
||||
parser.printHelpOn(new PrintStream(actual));
|
||||
|
|
Loading…
Add table
Reference in a new issue