Skip to content

Commit f577183

Browse files
committed
Minor patch so that the unit test cases work on Windows. The main change is that end of line characters can be different on different platforms.
So made the test less whitespace sensitive. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/trunk@129818 13f79535-47bb-0310-9956-ffa450edef68
1 parent c08f738 commit f577183

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/test/org/apache/commons/cli/TestHelpFormatter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,22 +150,22 @@ public void testAutomaticUsage()
150150
{
151151
HelpFormatter hf = new HelpFormatter();
152152
Options options = null;
153-
String expected = "usage: app [-a]\n";
153+
String expected = "usage: app [-a]";
154154
ByteArrayOutputStream out = new ByteArrayOutputStream( );
155155
PrintWriter pw = new PrintWriter( out );
156156

157157
options = new Options().addOption("a", false, "aaaa aaaa aaaa aaaa aaaa");
158158
hf.printUsage( pw, 60, "app", options );
159159
pw.flush();
160-
assertEquals("simple auto usage", expected, out.toString());
160+
assertEquals("simple auto usage", expected, out.toString().trim());
161161
out.reset();
162162

163-
expected = "usage: app [-b] [-a]\n";
163+
expected = "usage: app [-b] [-a]";
164164
options = new Options().addOption("a", false, "aaaa aaaa aaaa aaaa aaaa")
165165
.addOption("b", false, "bbb" );
166166
hf.printUsage( pw, 60, "app", options );
167167
pw.flush();
168-
assertEquals("simple auto usage", expected, out.toString());
168+
assertEquals("simple auto usage", expected, out.toString().trim());
169169
out.reset();
170170
}
171171
}

0 commit comments

Comments
 (0)