summaryrefslogtreecommitdiffstats
path: root/tests/com/gitblit
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-08-10 17:46:11 -0400
committerJames Moger <james.moger@gitblit.com>2012-08-10 17:46:11 -0400
commiteb870fc034460c2bab69039b21049d332a002ca1 (patch)
treefa16e26f61469334e6bfb1353de283860686c129 /tests/com/gitblit
parent88fb67f6cfdef7a3d44691aca623d3486fec3655 (diff)
downloadgitblit-eb870fc034460c2bab69039b21049d332a002ca1.tar.gz
gitblit-eb870fc034460c2bab69039b21049d332a002ca1.zip
Submodules support
Diffstat (limited to 'tests/com/gitblit')
-rw-r--r--tests/com/gitblit/tests/StringUtilsTest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/com/gitblit/tests/StringUtilsTest.java b/tests/com/gitblit/tests/StringUtilsTest.java
index 91bfa672..bcf3a99c 100644
--- a/tests/com/gitblit/tests/StringUtilsTest.java
+++ b/tests/com/gitblit/tests/StringUtilsTest.java
@@ -150,4 +150,11 @@ public class StringUtilsTest {
assertFalse(StringUtils.fuzzyMatch("123", "12345"));
assertFalse(StringUtils.fuzzyMatch("AbCdEfHIJ", "abc*hhh"));
}
+
+ @Test
+ public void testGetRepositoryPath() throws Exception {
+ assertEquals("gitblit/gitblit.git", StringUtils.extractRepositoryPath("git://github.com/gitblit/gitblit.git", new String [] { ".*?://github.com/(.*)" }));
+ assertEquals("gitblit.git", StringUtils.extractRepositoryPath("git://github.com/gitblit/gitblit.git", new String [] { ".*?://github.com/[^/].*?/(.*)" }));
+ assertEquals("gitblit.git", StringUtils.extractRepositoryPath("git://github.com/gitblit/gitblit.git"));
+ }
}