Skip to content

Commit 440a87a

Browse files
linquizeVicent Marti
authored andcommitted
Add unit test to test add section without lf at EOF
1 parent 190fe07 commit 440a87a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/config/write.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,22 @@ void test_config_write__add_value_at_file_with_no_clrf_at_the_end(void)
229229
git_config_free(cfg);
230230
}
231231

232+
void test_config_write__add_section_at_file_with_no_clrf_at_the_end(void)
233+
{
234+
git_config *cfg;
235+
int i;
236+
237+
cl_git_pass(git_config_open_ondisk(&cfg, "config17"));
238+
cl_git_pass(git_config_set_int32(cfg, "diff.context", 10));
239+
git_config_free(cfg);
240+
241+
cl_git_pass(git_config_open_ondisk(&cfg, "config17"));
242+
cl_git_pass(git_config_get_int32(&i, cfg, "diff.context"));
243+
cl_assert_equal_i(10, i);
244+
245+
git_config_free(cfg);
246+
}
247+
232248
void test_config_write__add_value_which_needs_quotes(void)
233249
{
234250
git_config *cfg;

0 commit comments

Comments
 (0)