diff options
| author | Russell Belfer <rb@github.com> | 2012-04-16 10:10:05 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2012-04-16 10:10:05 -0700 |
| commit | e8c3774f9bce47f2693e72773a28a7aff252473c (patch) | |
| tree | 35bc0d20152a27dfbe1a365908cfb77664ad8f40 /tests-clar | |
| parent | 3fa1ec4af63f30c8e205f18439f6eb5cc7e6898c (diff) | |
| parent | 2c1075d65a344f8fa166b4c1eb8320f389653187 (diff) | |
| download | libgit2-e8c3774f9bce47f2693e72773a28a7aff252473c.tar.gz | |
Merge pull request #599 from carlosmn/config-quotes
Support config value quoting
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); +} |
