mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-15 23:07:54 +00:00
Add another testcase to make sure double quotes are correctly escaped
Signed-off-by: Sven Strickroth <email@cs-ware.de>
This commit is contained in:
parent
a9f7236aff
commit
7dd28dde28
@ -236,12 +236,14 @@ void test_config_write__add_value_which_needs_quotes(void)
|
|||||||
const char* str2;
|
const char* str2;
|
||||||
const char* str3;
|
const char* str3;
|
||||||
const char* str4;
|
const char* str4;
|
||||||
|
const char* str5;
|
||||||
|
|
||||||
cl_git_pass(git_config_open_ondisk(&cfg, "config17"));
|
cl_git_pass(git_config_open_ondisk(&cfg, "config17"));
|
||||||
cl_git_pass(git_config_set_string(cfg, "core.startwithspace", " Something"));
|
cl_git_pass(git_config_set_string(cfg, "core.startwithspace", " Something"));
|
||||||
cl_git_pass(git_config_set_string(cfg, "core.endwithspace", "Something "));
|
cl_git_pass(git_config_set_string(cfg, "core.endwithspace", "Something "));
|
||||||
cl_git_pass(git_config_set_string(cfg, "core.containscommentchar1", "some#thing"));
|
cl_git_pass(git_config_set_string(cfg, "core.containscommentchar1", "some#thing"));
|
||||||
cl_git_pass(git_config_set_string(cfg, "core.containscommentchar2", "some;thing"));
|
cl_git_pass(git_config_set_string(cfg, "core.containscommentchar2", "some;thing"));
|
||||||
|
cl_git_pass(git_config_set_string(cfg, "core.startwhithsapceandcontainsdoublequote", " some\"thing"));
|
||||||
git_config_free(cfg);
|
git_config_free(cfg);
|
||||||
|
|
||||||
cl_git_pass(git_config_open_ondisk(&cfg, "config17"));
|
cl_git_pass(git_config_open_ondisk(&cfg, "config17"));
|
||||||
@ -253,6 +255,8 @@ void test_config_write__add_value_which_needs_quotes(void)
|
|||||||
cl_assert_equal_s("some#thing", str3);
|
cl_assert_equal_s("some#thing", str3);
|
||||||
cl_git_pass(git_config_get_string(&str4, cfg, "core.containscommentchar2"));
|
cl_git_pass(git_config_get_string(&str4, cfg, "core.containscommentchar2"));
|
||||||
cl_assert_equal_s("some;thing", str4);
|
cl_assert_equal_s("some;thing", str4);
|
||||||
|
cl_git_pass(git_config_get_string(&str5, cfg, "core.startwhithsapceandcontainsdoublequote"));
|
||||||
|
cl_assert_equal_s(" some\"thing", str5);
|
||||||
git_config_free(cfg);
|
git_config_free(cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user