Commit a447a7e4 by Linquize

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

parent 0a641647
......@@ -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_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_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_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_assert_equal_s("this is \ba phrase", str);
......
[some "section"]
test = hi ; comment
test2 = hello ; comment
test3 = welcome #comment
other = "hello! \" ; ; ; " ; more test
other2 = "cool! \" # # # " # more test
multi = "hi, this is a ; \
multiline comment # with ;\n special chars \
and other stuff !@#"
multi2 = "good, this is a ; \
multiline comment # with ;\n special chars \
and other stuff !@#" #^^^
back = "this is \ba phrase"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment