]> git.proxmox.com Git - libgit2.git/commitdiff
Add test for section header at end of file
authorCarlos Martín Nieto <cmn@elego.de>
Tue, 28 Jun 2011 14:27:16 +0000 (16:27 +0200)
committerVicent Marti <tanoku@gmail.com>
Tue, 5 Jul 2011 00:32:18 +0000 (02:32 +0200)
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
tests/resources/config/config10 [new file with mode: 0644]
tests/t15-config.c

diff --git a/tests/resources/config/config10 b/tests/resources/config/config10
new file mode 100644 (file)
index 0000000..dde1791
--- /dev/null
@@ -0,0 +1 @@
+[empty]
index 25cdcbd6508a44bd70652f658b649ce3c2adcf74..a4e11c3c8aa61d626312cad2501da171b515fc15 100644 (file)
@@ -263,6 +263,14 @@ BEGIN_TEST(config13, "can't delete a non-existent value")
        git_config_free(cfg);
 END_TEST
 
+BEGIN_TEST(config14, "don't fail horribly if a section header is in the last line")
+       git_config *cfg;
+
+       /* By freeing the config, we make sure we flush the values  */
+       must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config10"));
+       git_config_free(cfg);
+END_TEST
+
 BEGIN_SUITE(config)
         ADD_TEST(config0);
         ADD_TEST(config1);
@@ -278,4 +286,5 @@ BEGIN_SUITE(config)
         ADD_TEST(config11);
         ADD_TEST(config12);
         ADD_TEST(config13);
+        ADD_TEST(config14);
 END_SUITE