package gw.vark;

import org.junit.Assert;
import org.junit.Test;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * Created by IntelliJ IDEA.
 * User: bchang
 * Date: 3/20/12
 * Time: 8:24 PM
 * To change this template use File | Settings | File Templates.
 */
public class AardvarkHelpModeTest extends Assert {

  @Test
  public void printHelp() {
    StringWriter writer = new StringWriter();
    PrintWriter out = new PrintWriter(writer);
    AardvarkHelpMode.printHelp(out);
    assertEquals(
            "Usage:\n" +
                    "        vark [-f FILE] [options] [targets...]\n" +
                    "\n" +
                    "Options:\n" +
                    "        -f, -file FILE              load a file-based Gosu source\n" +
                    "            -url URL                load a url-based Gosu source\n" +
                    "            -classpath PATH         additional elements for the classpath, separated by commas\n" +
                    "        -p, -projecthelp            show project help (e.g. targets)\n" +
                    "            -logger LOGGERFQN       class name for a logger to use\n" +
                    "        -q, -quiet                  run with logging in quiet mode\n" +
                    "        -v, -verbose                run with logging in verbose mode\n" +
                    "        -d, -debug                  run with logging in debug mode\n" +
                    "            -verify                 verifies the Gosu source\n" +
                    "            -version                displays the version of Aardvark\n" +
                    "        -h, -help                   displays this command-line help\n" +
                    "",
            writer.toString());
  }
}

@@ -488,16 +488,71 @@
 p(out);%0A
+    String eol = System.getProperty(%22line.separator%22);%0A
     asse
@@ -580,19 +580,23 @@
  %22Usage:
-%5Cn%22
+%22 + eol
  +%0A     
@@ -656,21 +656,25 @@
 gets...%5D
-%5Cn
 %22 +
+ eol +
 %0A       
@@ -687,21 +687,25 @@
        %22
-%5Cn
 %22 +
+ eol +
 %0A       
@@ -726,19 +726,23 @@
 Options:
-%5Cn%22
+%22 + eol
  +%0A     
@@ -814,35 +814,39 @@
 ased Gosu source
-%5Cn%22
+%22 + eol
  +%0A             
@@ -909,35 +909,39 @@
 ased Gosu source
-%5Cn%22
+%22 + eol
  +%0A             
@@ -1042,21 +1042,25 @@
 y commas
-%5Cn
 %22 +
+ eol +
 %0A       
@@ -1141,21 +1141,25 @@
 targets)
-%5Cn
 %22 +
+ eol +
 %0A       
@@ -1238,21 +1238,25 @@
 r to use
-%5Cn
 %22 +
+ eol +
 %0A       
@@ -1331,29 +1331,33 @@
 n quiet mode
-%5Cn
 %22 +
+ eol +
 %0A           
@@ -1430,27 +1430,31 @@
 verbose mode
-%5Cn%22
+%22 + eol
  +%0A         
@@ -1531,19 +1531,23 @@
 bug mode
-%5Cn%22
+%22 + eol
  +%0A     
@@ -1622,21 +1622,25 @@
 u source
-%5Cn
 %22 +
+ eol +
 %0A       
@@ -1721,21 +1721,25 @@
 Aardvark
-%5Cn
 %22 +
+ eol +
 %0A       
@@ -1823,11 +1823,15 @@
 help
-%5Cn%22
+%22 + eol
  +%0A 

fix test for running in Windows