config: Add test cases that have trailing spaces before comment chars

This commit is contained in:
Linquize 2014-10-04 23:28:40 +08:00
parent 0a64164700
commit a447a7e40b
2 changed files with 12 additions and 0 deletions

View File

@ -44,12 +44,24 @@ void test_config_stress__comments(void)
cl_git_pass(git_config_open_ondisk(&config, cl_fixture("config/config12"))); cl_git_pass(git_config_open_ondisk(&config, cl_fixture("config/config12")));
cl_git_pass(git_config_get_string(&str, config, "some.section.test2"));
cl_assert_equal_s("hello", str);
cl_git_pass(git_config_get_string(&str, config, "some.section.test3"));
cl_assert_equal_s("welcome", str);
cl_git_pass(git_config_get_string(&str, config, "some.section.other")); cl_git_pass(git_config_get_string(&str, config, "some.section.other"));
cl_assert_equal_s("hello! \" ; ; ; ", str); cl_assert_equal_s("hello! \" ; ; ; ", str);
cl_git_pass(git_config_get_string(&str, config, "some.section.other2"));
cl_assert_equal_s("cool! \" # # # ", str);
cl_git_pass(git_config_get_string(&str, config, "some.section.multi")); cl_git_pass(git_config_get_string(&str, config, "some.section.multi"));
cl_assert_equal_s("hi, this is a ; multiline comment # with ;\n special chars and other stuff !@#", str); cl_assert_equal_s("hi, this is a ; multiline comment # with ;\n special chars and other stuff !@#", str);
cl_git_pass(git_config_get_string(&str, config, "some.section.multi2"));
cl_assert_equal_s("good, this is a ; multiline comment # with ;\n special chars and other stuff !@#", str);
cl_git_pass(git_config_get_string(&str, config, "some.section.back")); cl_git_pass(git_config_get_string(&str, config, "some.section.back"));
cl_assert_equal_s("this is \ba phrase", str); cl_assert_equal_s("this is \ba phrase", str);

Binary file not shown.