From 466413cc4c3f6dca55359eb620fd1e1cd2d3f47b Mon Sep 17 00:00:00 2001 From: James Moger <jmoger@vas.com> Date: Thu, 06 Oct 2011 20:48:31 -0400 Subject: [PATCH] Set the RSS content type for Firefox 4 (issue 22) --- tests/com/gitblit/tests/StringUtilsTest.java | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/tests/com/gitblit/tests/StringUtilsTest.java b/tests/com/gitblit/tests/StringUtilsTest.java index 665b914..489972a 100644 --- a/tests/com/gitblit/tests/StringUtilsTest.java +++ b/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")); + } } -- Gitblit v1.9.1