Skip to content

Commit f140950

Browse files
committed
Write a test.
1 parent ec76a1a commit f140950

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tests/config/read.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,3 +758,18 @@ void test_config_read__bom(void)
758758
git_config_free(cfg);
759759
git_buf_dispose(&buf);
760760
}
761+
762+
/* This would ideally issue a warning, if we had a way to do so. */
763+
void test_config_read__nosection(void)
764+
{
765+
git_config *cfg;
766+
git_buf buf = GIT_BUF_INIT;
767+
768+
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config-nosection")));
769+
770+
cl_git_pass(git_config_get_string_buf(&buf, cfg, "key"));
771+
cl_assert_equal_s(buf.ptr, "value");
772+
773+
git_buf_dispose(&buf);
774+
git_config_free(cfg);
775+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
key = value

0 commit comments

Comments
 (0)