|
|
@@ -323,11 +323,12 @@ public class OpenSshConfigTest extends RepositoryTestCase { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testListValueMultiple() throws Exception { |
|
|
|
// Tilde expansion doesn't occur within the parser |
|
|
|
// Tilde expansion occurs within the parser |
|
|
|
config("Host orcz\nUserKnownHostsFile \"~/foo/ba z\" /foo/bar \n"); |
|
|
|
final ConfigRepository.Config c = osc.getConfig("orcz"); |
|
|
|
assertNotNull(c); |
|
|
|
assertArrayEquals(new Object[] { "~/foo/ba z", "/foo/bar" }, |
|
|
|
assertArrayEquals(new Object[] { new File(home, "foo/ba z").getPath(), |
|
|
|
"/foo/bar" }, |
|
|
|
c.getValues("UserKnownHostsFile")); |
|
|
|
} |
|
|
|
|
|
|
@@ -371,8 +372,9 @@ public class OpenSshConfigTest extends RepositoryTestCase { |
|
|
|
// Host does tilde replacement |
|
|
|
assertEquals(new File(home, "foo/ba z"), f); |
|
|
|
final ConfigRepository.Config c = h.getConfig(); |
|
|
|
// Config doesn't |
|
|
|
assertArrayEquals(new Object[] { "~/foo/ba z", "/foo/bar" }, |
|
|
|
// Config does tilde replacement, too |
|
|
|
assertArrayEquals(new Object[] { new File(home, "foo/ba z").getPath(), |
|
|
|
"/foo/bar" }, |
|
|
|
c.getValues("IdentityFile")); |
|
|
|
} |
|
|
|
|
|
|
@@ -386,8 +388,9 @@ public class OpenSshConfigTest extends RepositoryTestCase { |
|
|
|
// Host does tilde replacement |
|
|
|
assertEquals(new File(home, "foo/ba z"), f); |
|
|
|
final ConfigRepository.Config c = h.getConfig(); |
|
|
|
// Config doesn't |
|
|
|
assertArrayEquals(new Object[] { "~/foo/ba z", "/foo/bar", "/foo/baz" }, |
|
|
|
// Config does tilde replacement, too |
|
|
|
assertArrayEquals(new Object[] { new File(home, "foo/ba z").getPath(), |
|
|
|
"/foo/bar", "/foo/baz" }, |
|
|
|
c.getValues("IdentityFile")); |
|
|
|
} |
|
|
|
|
|
|
@@ -397,7 +400,7 @@ public class OpenSshConfigTest extends RepositoryTestCase { |
|
|
|
final Host h = osc.lookup("repo.or.cz"); |
|
|
|
assertNotNull(h); |
|
|
|
assertEquals(new File(home, "foo/bar"), h.getIdentityFile()); |
|
|
|
assertArrayEquals(new Object[] { "~/foo/bar" }, |
|
|
|
assertArrayEquals(new Object[] { new File(home, "foo/bar").getPath() }, |
|
|
|
h.getConfig().getValues("IdentityFile")); |
|
|
|
} |
|
|
|
|
|
|
@@ -407,7 +410,8 @@ public class OpenSshConfigTest extends RepositoryTestCase { |
|
|
|
final Host h = osc.lookup("repo.or.cz"); |
|
|
|
assertNotNull(h); |
|
|
|
assertEquals(new File(home, "foo/bar"), h.getIdentityFile()); |
|
|
|
assertArrayEquals(new Object[] { "~/foo/bar", "/foo/baz" }, |
|
|
|
assertArrayEquals(new Object[] { new File(home, "foo/bar").getPath(), |
|
|
|
"/foo/baz" }, |
|
|
|
h.getConfig().getValues("IdentityFile")); |
|
|
|
} |
|
|
|
|
|
|
@@ -417,12 +421,13 @@ public class OpenSshConfigTest extends RepositoryTestCase { |
|
|
|
final Host h1 = osc.lookup("repo.or.cz"); |
|
|
|
assertNotNull(h1); |
|
|
|
assertEquals(new File(home, "foo/bar"), h1.getIdentityFile()); |
|
|
|
assertArrayEquals(new Object[] { "~/foo/bar", "/foo/baz" }, |
|
|
|
assertArrayEquals(new Object[] { new File(home, "foo/bar").getPath(), |
|
|
|
"/foo/baz" }, |
|
|
|
h1.getConfig().getValues("IdentityFile")); |
|
|
|
final Host h2 = osc.lookup("orcz"); |
|
|
|
assertNotNull(h2); |
|
|
|
assertEquals(new File(home, "foo/bar"), h2.getIdentityFile()); |
|
|
|
assertArrayEquals(new Object[] { "~/foo/bar" }, |
|
|
|
assertArrayEquals(new Object[] { new File(home, "foo/bar").getPath() }, |
|
|
|
h2.getConfig().getValues("IdentityFile")); |
|
|
|
} |
|
|
|
|