Commit 30d0550da8e73d409407fe01133628c9594d63fc

Carlos Martín Nieto 2011-05-31T16:31:19

Add test for invalid ext header Signed-off-by: Carlos Martín Nieto <cmn@elego.de>

diff --git a/tests/resources/config/config7 b/tests/resources/config/config7
new file mode 100644
index 0000000..6af6fcf
--- /dev/null
+++ b/tests/resources/config/config7
@@ -0,0 +1,5 @@
+[valid "subsection"]
+    something = a
+; we don't allow anything after closing "
+[sec "subsec"x]
+    bleh = blah
diff --git a/tests/t15-config.c b/tests/t15-config.c
index a93caad..4a3c0dc 100644
--- a/tests/t15-config.c
+++ b/tests/t15-config.c
@@ -174,6 +174,13 @@ BEGIN_TEST(config6, "test blank lines")
 	git_config_free(cfg);
 END_TEST
 
+BEGIN_TEST(config7, "test for invalid ext headers")
+	git_config *cfg;
+
+	must_fail(git_config_open_file(&cfg, CONFIG_BASE "/config7"));
+
+END_TEST
+
 BEGIN_SUITE(config)
 	 ADD_TEST(config0);
 	 ADD_TEST(config1);
@@ -182,4 +189,5 @@ BEGIN_SUITE(config)
 	 ADD_TEST(config4);
 	 ADD_TEST(config5);
 	 ADD_TEST(config6);
+	 ADD_TEST(config7);
 END_SUITE