Skip to content

Commit

Permalink
[remkop#1380] use OS-independent line breaks in test
Browse files Browse the repository at this point in the history
  • Loading branch information
remkop committed Feb 10, 2022
1 parent b27c7be commit 020a770
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ public void testingWithExclusiveTrue() {
new CommandLine(new TestingClassExclusiveTrue()).usage(printStream);

String returnedText = tempOut.toString();
String expectedText =
"Usage: <main class> [-s | -v | -j]\n"+
" -j, --json JSON printing\n"+
" -s, --silent Silent mode\n"+
" -v, --verbose Verbose mode\n";
String expectedText = String.format(
"Usage: <main class> [-s | -v | -j]%n"+
" -j, --json JSON printing%n"+
" -s, --silent Silent mode%n"+
" -v, --verbose Verbose mode%n");

assertEquals(expectedText, returnedText);
}
Expand All @@ -78,10 +78,11 @@ public void testingWithExclusiveFalse() {
new CommandLine(new TestingClassExclusiveFalse()).usage(printStream);

String returnedText = tempOut.toString();
String expectedText = "Usage: <main class> [[-s] [-v] [-j]]\n" +
" -j, --json JSON printing\n" +
" -s, --silent Silent mode\n" +
" -v, --verbose Verbose mode\n";
String expectedText = String.format(
"Usage: <main class> [[-s] [-v] [-j]]%n" +
" -j, --json JSON printing%n" +
" -s, --silent Silent mode%n" +
" -v, --verbose Verbose mode%n");

assertEquals(expectedText, returnedText);
}
Expand Down

0 comments on commit 020a770

Please sign in to comment.