diff options
author | Dave Borowitz <dborowitz@google.com> | 2013-02-08 11:35:20 -0800 |
---|---|---|
committer | Dave Borowitz <dborowitz@google.com> | 2013-02-08 11:36:50 -0800 |
commit | 51d0e1f26e23d04ae73054958546159e01196a4d (patch) | |
tree | caf8cd9cc100fc300e5e7891f32eb052993854b7 /org.eclipse.jgit.test | |
parent | 3a4ebc0c24b7732a57064299153794084fbfae59 (diff) | |
download | jgit-51d0e1f26e23d04ae73054958546159e01196a4d.tar.gz jgit-51d0e1f26e23d04ae73054958546159e01196a4d.zip |
Fix Config.fromText to not skip a last line with no newline
Change-Id: Id6da6ff19296410806282bb7419fd8455e8c5475
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java index f074273137..e5e1e7ad6e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java @@ -556,6 +556,15 @@ public class ConfigTest { assertEquals(result, config.toText()); } + @Test + public void testNoFinalNewline() throws ConfigInvalidException { + Config c = parse("[a]\n" + + "x = 0\n" + + "y = 1"); + assertEquals("0", c.getString("a", null, "x")); + assertEquals("1", c.getString("a", null, "y")); + } + private static void assertReadLong(long exp) throws ConfigInvalidException { assertReadLong(exp, String.valueOf(exp)); } |