summaryrefslogtreecommitdiff
path: root/tests/config
diff options
context:
space:
mode:
authorNelson Elhage <nelhage@nelhage.com>2018-08-14 03:54:01 +0000
committerNelson Elhage <nelhage@nelhage.com>2018-08-14 03:54:01 +0000
commitf140950066cf2989912e18ad92ec088f624b8bf2 (patch)
tree53a0e32ab9c21c5c76940d68c1605e7dc2185448 /tests/config
parentec76a1aa43321db2451e747d7a4408e780991c4a (diff)
downloadlibgit2-f140950066cf2989912e18ad92ec088f624b8bf2.tar.gz
Write a test.
Diffstat (limited to 'tests/config')
-rw-r--r--tests/config/read.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/config/read.c b/tests/config/read.c
index ddc5c8ce6..d441ce838 100644
--- a/tests/config/read.c
+++ b/tests/config/read.c
@@ -758,3 +758,18 @@ void test_config_read__bom(void)
git_config_free(cfg);
git_buf_dispose(&buf);
}
+
+/* This would ideally issue a warning, if we had a way to do so. */
+void test_config_read__nosection(void)
+{
+ git_config *cfg;
+ git_buf buf = GIT_BUF_INIT;
+
+ cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config-nosection")));
+
+ cl_git_pass(git_config_get_string_buf(&buf, cfg, "key"));
+ cl_assert_equal_s(buf.ptr, "value");
+
+ git_buf_dispose(&buf);
+ git_config_free(cfg);
+}