summaryrefslogtreecommitdiff
path: root/tests-clar/config/read.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-08-12 07:59:30 -0700
committerRussell Belfer <rb@github.com>2012-08-12 07:59:30 -0700
commita1ecddf01c5546b3f29cd546f4a469263cc6785e (patch)
tree256c14d824feba4e83a52cfdf2a5b1defe1c2b2b /tests-clar/config/read.c
parentc9d78bde943213f4c2594d1df175336573678b74 (diff)
downloadlibgit2-a1ecddf01c5546b3f29cd546f4a469263cc6785e.tar.gz
Fix config parser boundary logic
The config file parser was not working right if there was no whitespace between the value name and the equals sign. This fixes that.
Diffstat (limited to 'tests-clar/config/read.c')
-rw-r--r--tests-clar/config/read.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests-clar/config/read.c b/tests-clar/config/read.c
index 574ff8196..fcd22463d 100644
--- a/tests-clar/config/read.c
+++ b/tests-clar/config/read.c
@@ -266,6 +266,22 @@ void test_config_read__foreach_match(void)
git_config_free(cfg);
}
+void test_config_read__whitespace_not_required_around_assignment(void)
+{
+ git_config *cfg;
+ const char *str;
+
+ cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config14")));
+
+ cl_git_pass(git_config_get_string(&str, cfg, "a.b"));
+ cl_assert_equal_s(str, "c");
+
+ cl_git_pass(git_config_get_string(&str, cfg, "d.e"));
+ cl_assert_equal_s(str, "f");
+
+ git_config_free(cfg);
+}
+
#if 0
BEGIN_TEST(config10, "a repo's config overrides the global config")