From 4ca2de65b7d82cd14181240cfb7a5d0dab8b48dd Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Fri, 14 Nov 2014 14:14:42 +0100 Subject: [PATCH] More tests. --- test/followSymlink.expected | 4 ++++ test/helper.vim | 2 -- test/test | 5 ++++- test/testFollowSymlink.vim | 10 ++++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 test/followSymlink.expected create mode 100644 test/testFollowSymlink.vim diff --git a/test/followSymlink.expected b/test/followSymlink.expected new file mode 100644 index 0000000..8f8fb4a --- /dev/null +++ b/test/followSymlink.expected @@ -0,0 +1,4 @@ + +--- Signs --- +Signs for symlink: + line=5 id=3000 name=GitGutterLineRemoved diff --git a/test/helper.vim b/test/helper.vim index ec23e4d..9a5c15c 100644 --- a/test/helper.vim +++ b/test/helper.vim @@ -2,8 +2,6 @@ set runtimepath+=../ source ../plugin/gitgutter.vim function! Setup() - call system('git reset HEAD fixture.txt') - call system('git checkout fixture.txt') edit! fixture.txt sign unplace * endfunction diff --git a/test/test b/test/test index b08f87c..85f7df4 100755 --- a/test/test +++ b/test/test @@ -8,6 +8,9 @@ rm -f *.actual # Execute the tests. for testcase in test*.vim; do + git reset HEAD fixture.txt > /dev/null + git checkout fixture.txt + vim -N -u NONE -S $testcase -c 'quit!' done @@ -22,6 +25,7 @@ for expected in *.expected; do if diff $expected $actual; then count_ok=$((count_ok + 1)) echo "$name ok" + rm $actual else count_fail=$((count_fail + 1)) echo "$name failed" @@ -31,7 +35,6 @@ done # Clean up. git reset HEAD fixture.txt > /dev/null git checkout fixture.txt -# rm -f *.actual # Print results. echo diff --git a/test/testFollowSymlink.vim b/test/testFollowSymlink.vim new file mode 100644 index 0000000..fda33ec --- /dev/null +++ b/test/testFollowSymlink.vim @@ -0,0 +1,10 @@ +source helper.vim + +let tmpfile = 'symlink' +call system('ln -nfs fixture.txt '.tmpfile) +execute 'edit '.tmpfile +execute '6d' +write +call DumpSigns('followSymlink') + +call system('rm '.tmpfile)