From a447a7e40b03d1c8ecb49ab0ef015eb4c0fd2b6e Mon Sep 17 00:00:00 2001 From: Linquize Date: Sat, 4 Oct 2014 23:28:40 +0800 Subject: [PATCH] config: Add test cases that have trailing spaces before comment chars --- tests/config/stress.c | 12 ++++++++++++ tests/resources/config/config12 | Bin 221 -> 440 bytes 2 files changed, 12 insertions(+) diff --git a/tests/config/stress.c b/tests/config/stress.c index 488915e79..e8e9d2b61 100644 --- a/tests/config/stress.c +++ b/tests/config/stress.c @@ -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); diff --git a/tests/resources/config/config12 b/tests/resources/config/config12 index b57a81b08a3fa00f9df494ecc29f95145117a72e..6917880b5c94e5d2d0db23cc7d9eb3c7809fa508 100644 GIT binary patch delta 122 zcmcc1xPy6up>auSafy+FtwKg>PENi85LhcD=jZ08=9O@PcnS(21;#)H<*7M9iBtsz z<%!DHviT($sYM`tO3C^8If@D~N(#zgs032rTf&!Hnp2VqR*;^bpE5BskPRpi7Z*2i GmofmUA0vVQ delta 16 YcmdnNe3x;8;lv`{iD#21&ta4S06M`2m;e9(