You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/10/04 13:06:58 UTC

cvs commit: jakarta-commons/cli/src/test/org/apache/commons/cli TestHelpFormatter.java

jstrachan    2002/10/04 04:06:58

  Modified:    cli/src/test/org/apache/commons/cli TestHelpFormatter.java
  Log:
  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.
  
  Revision  Changes    Path
  1.5       +4 -4      jakarta-commons/cli/src/test/org/apache/commons/cli/TestHelpFormatter.java
  
  Index: TestHelpFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli/TestHelpFormatter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestHelpFormatter.java	19 Sep 2002 22:59:44 -0000	1.4
  +++ TestHelpFormatter.java	4 Oct 2002 11:06:58 -0000	1.5
  @@ -150,22 +150,22 @@
      {
          HelpFormatter hf = new HelpFormatter();
          Options options = null;
  -       String expected = "usage: app [-a]\n";
  +       String expected = "usage: app [-a]";
          ByteArrayOutputStream out = new ByteArrayOutputStream( );
          PrintWriter pw = new PrintWriter( out );
   
          options = new Options().addOption("a", false, "aaaa aaaa aaaa aaaa aaaa");
          hf.printUsage( pw, 60, "app", options );
          pw.flush();
  -       assertEquals("simple auto usage", expected, out.toString());
  +       assertEquals("simple auto usage", expected, out.toString().trim());
          out.reset();
   
  -       expected = "usage: app [-b] [-a]\n";
  +       expected = "usage: app [-b] [-a]";
          options = new Options().addOption("a", false, "aaaa aaaa aaaa aaaa aaaa")
          .addOption("b", false, "bbb" );
          hf.printUsage( pw, 60, "app", options );
          pw.flush();
  -       assertEquals("simple auto usage", expected, out.toString());
  +       assertEquals("simple auto usage", expected, out.toString().trim());
          out.reset();
      }
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>