From a7206c41fc174f576b3f7085d48319dbdad760a5 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Tue, 8 May 2018 16:26:48 +0100 Subject: [PATCH] Add test for files with leading dash. --- test/test_gitgutter.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_gitgutter.vim b/test/test_gitgutter.vim index 4cf82c5..98b4220 100644 --- a/test/test_gitgutter.vim +++ b/test/test_gitgutter.vim @@ -167,6 +167,20 @@ function Test_filename_with_square_brackets() endfunction +function Test_filename_leading_dash() + call system('touch -- -fixture.txt && git add -- -fixture.txt') + edit -fixture.txt + normal ggo* + call s:trigger_gitgutter() + + let expected = [ + \ 'line=1 id=3000 name=GitGutterLineAdded', + \ 'line=2 id=3001 name=GitGutterLineAdded' + \ ] + call assert_equal(expected, s:signs('-fixture.txt')) +endfunction + + " FIXME: this test fails when it is the first (or only) test to be run function Test_follow_symlink() let tmp = 'symlink'