diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2021-12-23 15:03:08 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-23 15:03:08 -0500 |
| commit | 05c3d972be68c33fdd397d4b2cf6f090d4b3f994 (patch) | |
| tree | 7deeac87d0c273cd09d0100ff2fdc0cbce8eb882 /tests/config/write.c | |
| parent | 3cca14b3c1182f093d7e2d9c7de8bcb8b8828163 (diff) | |
| parent | dff05bc308f40fe327364334eaae412afca8ad61 (diff) | |
| download | libgit2-05c3d972be68c33fdd397d4b2cf6f090d4b3f994.tar.gz | |
Merge pull request #6124 from csware/config-parsing
Config parsing
Diffstat (limited to 'tests/config/write.c')
| -rw-r--r-- | tests/config/write.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/config/write.c b/tests/config/write.c index 4ee83833f..9d8c3fe94 100644 --- a/tests/config/write.c +++ b/tests/config/write.c @@ -8,6 +8,7 @@ void test_config_write__initialize(void) cl_fixture_sandbox("config/config9"); cl_fixture_sandbox("config/config15"); cl_fixture_sandbox("config/config17"); + cl_fixture_sandbox("config/config22"); } void test_config_write__cleanup(void) @@ -15,6 +16,7 @@ void test_config_write__cleanup(void) cl_fixture_cleanup("config9"); cl_fixture_cleanup("config15"); cl_fixture_cleanup("config17"); + cl_fixture_cleanup("config22"); } void test_config_write__replace_value(void) @@ -743,3 +745,20 @@ void test_config_write__preserve_case(void) git_config_free(cfg); } + +void test_config_write__write_config_file_with_multi_line_value(void) +{ + git_config* cfg; + git_buf buf = GIT_BUF_INIT; + + cl_git_pass(git_config_open_ondisk(&cfg, "config22")); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "alias.m")); + cl_assert_equal_s("cmd ;; ;; bar", buf.ptr); + cl_git_pass(git_config_set_string(cfg, "sOMe.ThInG", "foo")); + git_buf_dispose(&buf); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "alias.m")); + cl_assert_equal_s("cmd ;; ;; bar", buf.ptr); + git_buf_dispose(&buf); + + git_config_free(cfg); +} |
