From 831469ba89ea8bca3bfbd1d662dbdd2c9f233798 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Mon, 12 Sep 2011 15:37:55 -0400 Subject: [PATCH] Largely completed, uber-cool federation feature. --- 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