diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2019-04-08 12:52:36 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2019-04-11 09:09:47 +0900 |
commit | dff4f6cc74d54e28252d9c83cc486bf1c8e26d5b (patch) | |
tree | 3c7861b67d564b75a3398c78e61776ea6b12b924 /org.eclipse.jgit.test | |
parent | 93a0e50ed087ec2de2b57483d2775a20fab03b75 (diff) | |
download | jgit-dff4f6cc74d54e28252d9c83cc486bf1c8e26d5b.tar.gz jgit-dff4f6cc74d54e28252d9c83cc486bf1c8e26d5b.zip |
ConfigTest: Add test for parsing invalid group header
Test that an exception is raised for an invalid group header:
[group "foo" ]
foo = bar
i.e. where there is a space between the group subsection name
and the closing ']'.
Change-Id: I8933ae100b77634b0afb66bb8aa43d24c955799e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java | 7 |
1 files changed, 7 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 21d8d66adf..5a4bd886ab 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 @@ -1450,6 +1450,13 @@ public class ConfigTest { assertEquals("xt", parseEscapedSubsection("\"x\\t\"")); } + @Test + public void testInvalidGroupHeader() throws ConfigInvalidException { + expectedEx.expect(ConfigInvalidException.class); + expectedEx.expectMessage(JGitText.get().badGroupHeader); + parse("[foo \"bar\" ]\nfoo=bar\n"); + } + private static void assertValueRoundTrip(String value) throws ConfigInvalidException { assertValueRoundTrip(value, value); |