James Moger
2011-10-23 fe326255202dcfac8b0991ca9d28e3cf4bcc4fe6
tests/com/gitblit/tests/StringUtilsTest.java
@@ -103,4 +103,22 @@
      assertTrue(strings.get(2).equals("C"));
      assertTrue(strings.get(3).equals("D"));
   }
   public void testStringsFromValue2() throws Exception {
      List<String> strings = StringUtils.getStringsFromValue("common/* libraries/*");
      assertTrue(strings.size() == 2);
      assertTrue(strings.get(0).equals("common/*"));
      assertTrue(strings.get(1).equals("libraries/*"));
   }
   public void testFuzzyMatching() throws Exception {
      assertTrue(StringUtils.fuzzyMatch("12345", "12345"));
      assertTrue(StringUtils.fuzzyMatch("AbCdEf", "abcdef"));
      assertTrue(StringUtils.fuzzyMatch("AbCdEf", "abc*"));
      assertTrue(StringUtils.fuzzyMatch("AbCdEf", "*def"));
      assertTrue(StringUtils.fuzzyMatch("AbCdEfHIJ", "abc*hij"));
      assertFalse(StringUtils.fuzzyMatch("123", "12345"));
      assertFalse(StringUtils.fuzzyMatch("AbCdEfHIJ", "abc*hhh"));
   }
}