From d52a93fab330dbbe1271c10b527d333261638fe3 Mon Sep 17 00:00:00 2001 From: Linquize Date: Mon, 30 Sep 2013 23:58:58 +0800 Subject: [PATCH] Add test case to test ']' and '\\' characters in config subsection --- tests-clar/config/read.c | 7 +++++++ tests-clar/resources/config/config20 | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests-clar/resources/config/config20 diff --git a/tests-clar/config/read.c b/tests-clar/config/read.c index 722a15a71..ab068eaa7 100644 --- a/tests-clar/config/read.c +++ b/tests-clar/config/read.c @@ -164,6 +164,13 @@ void test_config_read__empty_files(void) git_config_free(cfg); } +void test_config_read__symbol_headers(void) +{ + git_config *cfg; + cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config20"))); + git_config_free(cfg); +} + void test_config_read__header_in_last_line(void) { git_config *cfg; diff --git a/tests-clar/resources/config/config20 b/tests-clar/resources/config/config20 new file mode 100644 index 000000000..8f0f12c4c --- /dev/null +++ b/tests-clar/resources/config/config20 @@ -0,0 +1,11 @@ +[valid "[subsection]"] + something = a +; we don't allow anything after closing " +[sec "[subsec]/child"] + parent = grand +[sec2 "[subsec2]/child2"] + type = dvcs +[sec3 "escape\"quote"] + vcs = git +[sec4 "escaping\\slash"] + lib = git2 -- 2.39.5