James Moger
2011-06-08 008322bec70a3a20bd00ed2219215a9f42fe0ca5
tests/com/gitblit/tests/StringUtilsTest.java
@@ -35,13 +35,13 @@
      String output = "this<br/>is<br/>a<br/>test<br/><br/>of<br/><br/>line<br/><br/>breaking";
      assertTrue(StringUtils.breakLinesForHtml(input).equals(output));
   }
   public void testEscapeForHtml() throws Exception {
      String input = "& < > \" \t";
      String output_nochange = "&amp; &lt; &gt; &quot; \t";
      String output_change = "&amp;&nbsp;&lt;&nbsp;&gt;&nbsp;&quot;&nbsp; &nbsp; &nbsp;";
      assertTrue(StringUtils.escapeForHtml(input, false).equals(output_nochange));
      assertTrue(StringUtils.escapeForHtml(input, true).equals(output_change));
      String outputNoChange = "&amp; &lt; &gt; &quot; \t";
      String outputChange = "&amp;&nbsp;&lt;&nbsp;&gt;&nbsp;&quot;&nbsp; &nbsp; &nbsp;";
      assertTrue(StringUtils.escapeForHtml(input, false).equals(outputNoChange));
      assertTrue(StringUtils.escapeForHtml(input, true).equals(outputChange));
   }
   public void testFlattenStrings() throws Exception {
@@ -64,11 +64,12 @@
      assertTrue(StringUtils.leftPad(input, input.length(), ' ').equals(input));
      assertTrue(StringUtils.rightPad(input, input.length(), ' ').equals(input));
   }
   public void testSHA1() throws Exception {
      assertTrue(StringUtils.getSHA1("blob 16\000what is up, doc?").equals("bd9dbf5aae1a3862dd1526723246b20206e5fc37"));
      assertTrue(StringUtils.getSHA1("blob 16\000what is up, doc?").equals(
            "bd9dbf5aae1a3862dd1526723246b20206e5fc37"));
   }
   public void testRootPath() throws Exception {
      String input = "/nested/path/to/repository";
      String output = "/nested/path/to";