aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorShawn Pearce <sop@google.com>2013-05-05 12:51:44 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2013-05-05 12:51:44 -0400
commit75e1bdb3c17b58a614e469137ae2435f80fe1531 (patch)
tree6d2b50e037caf61dec36db8ba5fb681c6ee29363 /org.eclipse.jgit.test
parentb0326235e1188e1931a9429c60c59495e43bd740 (diff)
parent23e3fb135bc7bb3c743369f42c1f2577e37811f3 (diff)
downloadjgit-75e1bdb3c17b58a614e469137ae2435f80fe1531.tar.gz
jgit-75e1bdb3c17b58a614e469137ae2435f80fe1531.zip
Merge "URIish: Allow multiple slashes in paths"
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
index 2202a91d3f..8c7c992b70 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
@@ -2,6 +2,7 @@
* Copyright (C) 2009, Mykola Nikishov <mn@mn.com.ua>
* Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
+ * Copyright (C) 2013, Robin Stocker <robin@nibor.org>
* and other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available
@@ -611,7 +612,7 @@ public class URIishTest {
@Test
public void testGetTwoSlashesDotGitHumanishName() throws URISyntaxException {
- assertEquals("", new URIish("/.git").getHumanishName());
+ assertEquals("", new URIish("//.git").getHumanishName());
}
@Test
@@ -646,7 +647,7 @@ public class URIishTest {
@Test
public void testGetSlashSlashDotGitSlashHumanishName()
throws IllegalArgumentException, URISyntaxException {
- final String humanishName = new URIish(GIT_SCHEME + "/abc//.git")
+ final String humanishName = new URIish(GIT_SCHEME + "/.git")
.getHumanishName();
assertEquals("may return an empty humanish name", "", humanishName);
}
@@ -703,6 +704,21 @@ public class URIishTest {
}
@Test
+ public void testGetValidLocalWithTwoSlashesHumanishName()
+ throws IllegalArgumentException, URISyntaxException {
+ String humanishName = new URIish("/a/b/c//").getHumanishName();
+ assertEquals("c", humanishName);
+ }
+
+ @Test
+ public void testGetValidGitSchemeWithTwoSlashesHumanishName()
+ throws IllegalArgumentException, URISyntaxException {
+ String humanishName = new URIish(GIT_SCHEME + "/a/b/c//")
+ .getHumanishName();
+ assertEquals("c", humanishName);
+ }
+
+ @Test
public void testGetWindowsPathHumanishName()
throws IllegalArgumentException,
URISyntaxException {