Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@elego.de>2011-06-28 18:27:16 +0400
committerVicent Marti <tanoku@gmail.com>2011-07-05 04:32:18 +0400
commit156af801e686e34685e2ac078a48d8224f3e33b4 (patch)
treeb9c32a3f237db4b1cc5ab8a86af7235f38cf7eff /tests
parentf58c53ce66cca0b42f615fc6773dbaf4e5fa566f (diff)
Add test for section header at end of file
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/resources/config/config101
-rw-r--r--tests/t15-config.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/resources/config/config10 b/tests/resources/config/config10
new file mode 100644
index 000000000..dde17911b
--- /dev/null
+++ b/tests/resources/config/config10
@@ -0,0 +1 @@
+[empty]
diff --git a/tests/t15-config.c b/tests/t15-config.c
index 25cdcbd65..a4e11c3c8 100644
--- a/tests/t15-config.c
+++ b/tests/t15-config.c
@@ -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