summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Strickroth <email@cs-ware.de>2021-11-25 11:02:41 +0100
committerSven Strickroth <email@cs-ware.de>2021-12-06 13:28:25 +0100
commit854164a5cad8681983f0912d7255d0845ef4f7c2 (patch)
tree3147fb0a45eb78dc2744b19ac6057c364c40ca35
parent433edb54b74cab470a1129cc8df5cbfaa0166c62 (diff)
downloadlibgit2-854164a5cad8681983f0912d7255d0845ef4f7c2.tar.gz
Add more tests for contents
Signed-off-by: Sven Strickroth <email@cs-ware.de>
-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 5d23ce471..a2e668c20 100644
--- a/tests/config/read.c
+++ b/tests/config/read.c
@@ -209,6 +209,21 @@ void test_config_read__symbol_headers(void)
{
git_config *cfg;
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config20")));
+ cl_git_pass(git_config_get_string_buf(&buf, cfg, "valid.[subsection].something"));
+ cl_assert_equal_s("a", buf.ptr);
+ git_buf_dispose(&buf);
+ cl_git_pass(git_config_get_string_buf(&buf, cfg, "sec.[subsec]/child.parent"));
+ cl_assert_equal_s("grand", buf.ptr);
+ git_buf_dispose(&buf);
+ cl_git_pass(git_config_get_string_buf(&buf, cfg, "sec2.[subsec2]/child2.type"));
+ cl_assert_equal_s("dvcs", buf.ptr);
+ git_buf_dispose(&buf);
+ cl_git_pass(git_config_get_string_buf(&buf, cfg, "sec3.escape\"quote.vcs"));
+ cl_assert_equal_s("git", buf.ptr);
+ git_buf_dispose(&buf);
+ cl_git_pass(git_config_get_string_buf(&buf, cfg, "sec4.escaping\\slash.lib"));
+ cl_assert_equal_s("git2", buf.ptr);
+ git_buf_dispose(&buf);
git_config_free(cfg);
}