From: Jonas Fonseca <fonseca@diku.dk>
To: Gilion Goudsmit <ggoudsmit@shebang.nl>
Cc: git@vger.kernel.org, spearce@spearce.org
Subject: [JGIT PATCH] Add test for OpenSshConfig separator parsing
Date: Sun, 21 Sep 2008 00:33:40 +0200 [thread overview]
Message-ID: <20080920223340.GB18981@diku.dk> (raw)
In-Reply-To: <20080920214808.GA7426@diku.dk>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
.../spearce/jgit/transport/OpenSshConfigTest.java | 24 ++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
I sent the previous patch a bit too early. This one has the assertions.
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/transport/OpenSshConfigTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/transport/OpenSshConfigTest.java
index 959b6b7..8c1133d 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/transport/OpenSshConfigTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/transport/OpenSshConfigTest.java
@@ -81,6 +81,30 @@ public void testNoConfig() {
assertNull(h.getIdentityFile());
}
+ public void testSeparatorParsing() throws Exception {
+ config("Host\tfirst\n" +
+ "\tHostName\tfirst.tld\n" +
+ "\n" +
+ "Host second\n" +
+ " HostName\tsecond.tld\n" +
+ "Host=third\n" +
+ "HostName=third.tld\n\n\n" +
+ "\t Host = fourth\n\n\n" +
+ " \t HostName\t=fourth.tld\n" +
+ "Host\t = last\n" +
+ "HostName \t last.tld");
+ assertNotNull(osc.lookup("first"));
+ assertEquals("first.tld", osc.lookup("first").getHostName());
+ assertNotNull(osc.lookup("second"));
+ assertEquals("second.tld", osc.lookup("second").getHostName());
+ assertNotNull(osc.lookup("third"));
+ assertEquals("third.tld", osc.lookup("third").getHostName());
+ assertNotNull(osc.lookup("fourth"));
+ assertEquals("fourth.tld", osc.lookup("fourth").getHostName());
+ assertNotNull(osc.lookup("last"));
+ assertEquals("last.tld", osc.lookup("last").getHostName());
+ }
+
public void testAlias_DoesNotMatch() throws Exception {
config("Host orcz\n" + "\tHostName repo.or.cz\n");
final Host h = osc.lookup("repo.or.cz");
--
1.6.0.2.444.gf2494
--
Jonas Fonseca
next prev parent reply other threads:[~2008-09-20 22:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-20 20:33 [JGIT PATCH] Fixed a bug that caused tabs in ~/.ssh/config to break parsing Gilion Goudsmit
2008-09-20 21:48 ` [JGIT PATCH] Add test for OpenSshConfig separator parsing Jonas Fonseca
2008-09-20 22:33 ` Jonas Fonseca [this message]
2008-09-20 22:18 ` [JGIT PATCH] Fixed a bug that caused tabs in ~/.ssh/config to break parsing Robin Rosenberg
2008-09-20 22:29 ` Jonas Fonseca
[not found] ` <bd6139dc0809201819o5d6eb5b1r7bf0e46702c711d7@mail.gmail.com>
2008-09-21 11:25 ` [JGIT PATCH] Test and fix handling of quotes in ~/.ssh/config Jonas Fonseca
2008-09-22 20:42 ` Robin Rosenberg
2008-09-22 21:07 ` Shawn O. Pearce
2008-09-24 23:25 ` Jonas Fonseca
2008-09-24 23:31 ` Shawn O. Pearce
2008-09-25 8:39 ` [JGIT PATCH] Add tests for handling of parsing errors in OpenSshConfig Jonas Fonseca
2008-09-25 11:33 ` Robin Rosenberg
2008-09-25 13:29 ` [JGIT RFC PATCH] Improve " Jonas Fonseca
2008-09-25 14:30 ` Jonas Fonseca
2008-09-25 15:16 ` Shawn O. Pearce
2008-09-25 6:26 ` [JGIT PATCH] Test and fix handling of quotes in ~/.ssh/config Robin Rosenberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080920223340.GB18981@diku.dk \
--to=fonseca@diku.dk \
--cc=ggoudsmit@shebang.nl \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).