diff options
Diffstat (limited to 'tests-clar')
| -rw-r--r-- | tests-clar/config/stress.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests-clar/config/stress.c b/tests-clar/config/stress.c index 25c2c66db..54a61ad67 100644 --- a/tests-clar/config/stress.c +++ b/tests-clar/config/stress.c @@ -37,3 +37,25 @@ void test_config_stress__dont_break_on_invalid_input(void) git_config_free(config); } + +void test_config_stress__comments(void) +{ + struct git_config_file *file; + git_config *config; + const char *str; + + cl_git_pass(git_config_file__ondisk(&file, cl_fixture("config/config12"))); + cl_git_pass(git_config_new(&config)); + cl_git_pass(git_config_add_file(config, file, 0)); + + cl_git_pass(git_config_get_string(config, "some.section.other", &str)); + cl_assert(!strcmp(str, "hello! \" ; ; ; ")); + + cl_git_pass(git_config_get_string(config, "some.section.multi", &str)); + cl_assert(!strcmp(str, "hi, this is a ; multiline comment # with ;\n special chars and other stuff !@#")); + + cl_git_pass(git_config_get_string(config, "some.section.back", &str)); + cl_assert(!strcmp(str, "this is \ba phrase")); + + git_config_free(config); +} |
