aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/vim-gitgutter/test
diff options
context:
space:
mode:
Diffstat (limited to 'vim/bundle/vim-gitgutter/test')
-rw-r--r--vim/bundle/vim-gitgutter/test/=fixture=.txt0
-rw-r--r--vim/bundle/vim-gitgutter/test/README.markdown30
-rw-r--r--vim/bundle/vim-gitgutter/test/addLines.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/addLinesFish.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/ambiguousFile.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/fileAddedToGit.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/filenameWithEquals.expected5
-rw-r--r--vim/bundle/vim-gitgutter/test/filenameWithSquareBrackets.expected5
-rw-r--r--vim/bundle/vim-gitgutter/test/fix[tu]re.txt0
-rw-r--r--vim/bundle/vim-gitgutter/test/fixture.txt11
-rw-r--r--vim/bundle/vim-gitgutter/test/followSymlink.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/helper.vim27
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopStageGitDiffStaged.expected0
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopUndoGitDiffStaged.expected0
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkOutsideNoopStageSigns.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkOutsideNoopUndoSigns.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkStageGitDiff.expected13
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiff.expected13
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiffStaged.expected12
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkStageNearbySigns.expected6
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkStageSigns.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkUndoGitDiff.expected0
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkUndoNearbyGitDiff.expected13
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkUndoNearbySigns.expected6
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkUndoSigns.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/keepAlt.expected3
-rw-r--r--vim/bundle/vim-gitgutter/test/keepModified.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/keepOpMarks.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/modifyLines.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/noModifications.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/orphanedSigns.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/removeFirstLines.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/removeLines.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/signColumnAlways.expected4
-rwxr-xr-xvim/bundle/vim-gitgutter/test/test50
-rw-r--r--vim/bundle/vim-gitgutter/test/testAddLines.vim6
-rw-r--r--vim/bundle/vim-gitgutter/test/testAddLinesFish.vim7
-rw-r--r--vim/bundle/vim-gitgutter/test/testEditAmbiguousFile.vim9
-rw-r--r--vim/bundle/vim-gitgutter/test/testFileAddedToGit.vim12
-rw-r--r--vim/bundle/vim-gitgutter/test/testFilenameWithEquals.vim12
-rw-r--r--vim/bundle/vim-gitgutter/test/testFilenameWithSquareBrackets.vim9
-rw-r--r--vim/bundle/vim-gitgutter/test/testFollowSymlink.vim10
-rw-r--r--vim/bundle/vim-gitgutter/test/testHunkOutsideNoop.vim13
-rw-r--r--vim/bundle/vim-gitgutter/test/testHunkStage.vim7
-rw-r--r--vim/bundle/vim-gitgutter/test/testHunkStageNearbyHunk.vim10
-rw-r--r--vim/bundle/vim-gitgutter/test/testHunkUndo.vim7
-rw-r--r--vim/bundle/vim-gitgutter/test/testHunkUndoNearbyHunk.vim9
-rw-r--r--vim/bundle/vim-gitgutter/test/testKeepAlt.vim12
-rw-r--r--vim/bundle/vim-gitgutter/test/testKeepModified.vim8
-rw-r--r--vim/bundle/vim-gitgutter/test/testKeepOpMarks.vim10
-rw-r--r--vim/bundle/vim-gitgutter/test/testModifyLines.vim6
-rw-r--r--vim/bundle/vim-gitgutter/test/testNoModifications.vim4
-rw-r--r--vim/bundle/vim-gitgutter/test/testOrphanedSigns.vim8
-rw-r--r--vim/bundle/vim-gitgutter/test/testRemoveFirstLines.vim6
-rw-r--r--vim/bundle/vim-gitgutter/test/testRemoveLines.vim6
-rw-r--r--vim/bundle/vim-gitgutter/test/testSignColumnAlways.vim7
-rw-r--r--vim/bundle/vim-gitgutter/test/testUntrackedFileOutsideRepo.vim6
-rw-r--r--vim/bundle/vim-gitgutter/test/testUntrackedFileSquareBracketsWithinRepo.vim10
-rw-r--r--vim/bundle/vim-gitgutter/test/testUntrackedFileWithinRepo.vim10
-rw-r--r--vim/bundle/vim-gitgutter/test/untrackedFileOutsideRepo.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/untrackedFileSquareBracketsWithinRepo.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/untrackedFileWithinRepo.expected2
62 files changed, 460 insertions, 0 deletions
diff --git a/vim/bundle/vim-gitgutter/test/=fixture=.txt b/vim/bundle/vim-gitgutter/test/=fixture=.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/=fixture=.txt
diff --git a/vim/bundle/vim-gitgutter/test/README.markdown b/vim/bundle/vim-gitgutter/test/README.markdown
new file mode 100644
index 0000000..2be0c37
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/README.markdown
@@ -0,0 +1,30 @@
+## Testing vim-gitgutter
+
+### Run the tests
+
+```sh
+$ cd test
+$ ./test
+```
+
+### Add a new test
+
+- Add a test file named like `testFoo.vim`. It should have this structure:
+
+```viml
+source helper.vim
+call Setup()
+
+" test code here
+```
+
+- Run the tests.
+- Inspect output (in `foo.actual`) from the new test. If good, copy it to `foo.expected`.
+- Run the tests to ensure new test's output is verified.
+- Commit changes.
+
+### Limitations
+
+- Currently tests are done by writing out a file and comparing it to a known good one.
+- There's no support for assertions within the testcase code.
+
diff --git a/vim/bundle/vim-gitgutter/test/addLines.expected b/vim/bundle/vim-gitgutter/test/addLines.expected
new file mode 100644
index 0000000..8e2c2ec
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/addLines.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=2 id=3000 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/addLinesFish.expected b/vim/bundle/vim-gitgutter/test/addLinesFish.expected
new file mode 100644
index 0000000..8e2c2ec
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/addLinesFish.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=2 id=3000 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/ambiguousFile.expected b/vim/bundle/vim-gitgutter/test/ambiguousFile.expected
new file mode 100644
index 0000000..1cd4e89
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/ambiguousFile.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=5 id=3000 name=GitGutterLineModified
diff --git a/vim/bundle/vim-gitgutter/test/fileAddedToGit.expected b/vim/bundle/vim-gitgutter/test/fileAddedToGit.expected
new file mode 100644
index 0000000..bfd8eeb
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/fileAddedToGit.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fileAddedToGit.tmp:
+ line=1 id=3000 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/filenameWithEquals.expected b/vim/bundle/vim-gitgutter/test/filenameWithEquals.expected
new file mode 100644
index 0000000..a78b977
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/filenameWithEquals.expected
@@ -0,0 +1,5 @@
+
+--- Signs ---
+Signs for =fixture=.txt:
+ line=1 id=3000 name=GitGutterLineAdded
+ line=2 id=3001 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/filenameWithSquareBrackets.expected b/vim/bundle/vim-gitgutter/test/filenameWithSquareBrackets.expected
new file mode 100644
index 0000000..18f3022
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/filenameWithSquareBrackets.expected
@@ -0,0 +1,5 @@
+
+--- Signs ---
+Signs for fix[tu]re.txt:
+ line=1 id=3000 name=GitGutterLineAdded
+ line=2 id=3001 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/fix[tu]re.txt b/vim/bundle/vim-gitgutter/test/fix[tu]re.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/fix[tu]re.txt
diff --git a/vim/bundle/vim-gitgutter/test/fixture.txt b/vim/bundle/vim-gitgutter/test/fixture.txt
new file mode 100644
index 0000000..f5c6aff
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/fixture.txt
@@ -0,0 +1,11 @@
+a
+b
+c
+d
+e
+f
+g
+h
+i
+j
+
diff --git a/vim/bundle/vim-gitgutter/test/followSymlink.expected b/vim/bundle/vim-gitgutter/test/followSymlink.expected
new file mode 100644
index 0000000..8f8fb4a
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/followSymlink.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for symlink:
+ line=5 id=3000 name=GitGutterLineRemoved
diff --git a/vim/bundle/vim-gitgutter/test/helper.vim b/vim/bundle/vim-gitgutter/test/helper.vim
new file mode 100644
index 0000000..aaccf39
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/helper.vim
@@ -0,0 +1,27 @@
+set runtimepath+=../
+source ../plugin/gitgutter.vim
+
+function! Setup()
+ edit! fixture.txt
+ sign unplace *
+endfunction
+
+function! DumpSigns(filename)
+ execute 'redir! > ' a:filename.'.actual'
+ silent execute 'sign place'
+ redir END
+endfunction
+
+function! DumpGitDiff(filename)
+ call system('git diff fixture.txt > '.a:filename.'.actual')
+endfunction
+
+function! DumpGitDiffStaged(filename)
+ call system('git diff --staged fixture.txt > '.a:filename.'.actual')
+endfunction
+
+function! Dump(text, filename)
+ let msg = type(a:text) == 1 ? split(a:text, '\n') : a:text
+ call writefile(msg, a:filename.'.actual', 'a')
+endfunction
+
diff --git a/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopStageGitDiffStaged.expected b/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopStageGitDiffStaged.expected
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopStageGitDiffStaged.expected
diff --git a/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopUndoGitDiffStaged.expected b/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopUndoGitDiffStaged.expected
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopUndoGitDiffStaged.expected
diff --git a/vim/bundle/vim-gitgutter/test/hunkOutsideNoopStageSigns.expected b/vim/bundle/vim-gitgutter/test/hunkOutsideNoopStageSigns.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkOutsideNoopStageSigns.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/hunkOutsideNoopUndoSigns.expected b/vim/bundle/vim-gitgutter/test/hunkOutsideNoopUndoSigns.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkOutsideNoopUndoSigns.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/hunkStageGitDiff.expected b/vim/bundle/vim-gitgutter/test/hunkStageGitDiff.expected
new file mode 100644
index 0000000..6f6a7fa
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkStageGitDiff.expected
@@ -0,0 +1,13 @@
+diff --git a/test/fixture.txt b/test/fixture.txt
+index f5c6aff..ae8e546 100644
+--- a/test/fixture.txt
++++ b/test/fixture.txt
+@@ -2,7 +2,7 @@ a
+ b
+ c
+ d
+-e
++*e
+ f
+ g
+ h
diff --git a/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiff.expected b/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiff.expected
new file mode 100644
index 0000000..6a0b7f0
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiff.expected
@@ -0,0 +1,13 @@
+diff --git a/test/fixture.txt b/test/fixture.txt
+index 53b13df..8fdfda7 100644
+--- a/test/fixture.txt
++++ b/test/fixture.txt
+@@ -1,5 +1,8 @@
+ a
+ b
++x
++y
++z
+ c
+ e
+ f
diff --git a/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiffStaged.expected b/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiffStaged.expected
new file mode 100644
index 0000000..8806576
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiffStaged.expected
@@ -0,0 +1,12 @@
+diff --git a/test/fixture.txt b/test/fixture.txt
+index f5c6aff..53b13df 100644
+--- a/test/fixture.txt
++++ b/test/fixture.txt
+@@ -1,7 +1,6 @@
+ a
+ b
+ c
+-d
+ e
+ f
+ g
diff --git a/vim/bundle/vim-gitgutter/test/hunkStageNearbySigns.expected b/vim/bundle/vim-gitgutter/test/hunkStageNearbySigns.expected
new file mode 100644
index 0000000..edfebd2
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkStageNearbySigns.expected
@@ -0,0 +1,6 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=3 id=3000 name=GitGutterLineAdded
+ line=4 id=3001 name=GitGutterLineAdded
+ line=5 id=3002 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/hunkStageSigns.expected b/vim/bundle/vim-gitgutter/test/hunkStageSigns.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkStageSigns.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/hunkUndoGitDiff.expected b/vim/bundle/vim-gitgutter/test/hunkUndoGitDiff.expected
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkUndoGitDiff.expected
diff --git a/vim/bundle/vim-gitgutter/test/hunkUndoNearbyGitDiff.expected b/vim/bundle/vim-gitgutter/test/hunkUndoNearbyGitDiff.expected
new file mode 100644
index 0000000..d480c7b
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkUndoNearbyGitDiff.expected
@@ -0,0 +1,13 @@
+diff --git a/test/fixture.txt b/test/fixture.txt
+index f5c6aff..3fbde56 100644
+--- a/test/fixture.txt
++++ b/test/fixture.txt
+@@ -1,5 +1,8 @@
+ a
+ b
++x
++y
++z
+ c
+ d
+ e
diff --git a/vim/bundle/vim-gitgutter/test/hunkUndoNearbySigns.expected b/vim/bundle/vim-gitgutter/test/hunkUndoNearbySigns.expected
new file mode 100644
index 0000000..edfebd2
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkUndoNearbySigns.expected
@@ -0,0 +1,6 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=3 id=3000 name=GitGutterLineAdded
+ line=4 id=3001 name=GitGutterLineAdded
+ line=5 id=3002 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/hunkUndoSigns.expected b/vim/bundle/vim-gitgutter/test/hunkUndoSigns.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkUndoSigns.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/keepAlt.expected b/vim/bundle/vim-gitgutter/test/keepAlt.expected
new file mode 100644
index 0000000..feee7b5
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/keepAlt.expected
@@ -0,0 +1,3 @@
+buffer: fixture.txt
+altbuffer:
+altbuffer:
diff --git a/vim/bundle/vim-gitgutter/test/keepModified.expected b/vim/bundle/vim-gitgutter/test/keepModified.expected
new file mode 100644
index 0000000..57a1bbf
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/keepModified.expected
@@ -0,0 +1,2 @@
+modified: 1
+modified: 1
diff --git a/vim/bundle/vim-gitgutter/test/keepOpMarks.expected b/vim/bundle/vim-gitgutter/test/keepOpMarks.expected
new file mode 100644
index 0000000..ed6b8c3
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/keepOpMarks.expected
@@ -0,0 +1,4 @@
+'[ mark: 0,6,1,0
+'] mark: 0,6,2,0
+'[ mark: 0,6,1,0
+'] mark: 0,6,2,0
diff --git a/vim/bundle/vim-gitgutter/test/modifyLines.expected b/vim/bundle/vim-gitgutter/test/modifyLines.expected
new file mode 100644
index 0000000..91ad42c
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/modifyLines.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=1 id=3000 name=GitGutterLineModified
diff --git a/vim/bundle/vim-gitgutter/test/noModifications.expected b/vim/bundle/vim-gitgutter/test/noModifications.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/noModifications.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/orphanedSigns.expected b/vim/bundle/vim-gitgutter/test/orphanedSigns.expected
new file mode 100644
index 0000000..1beeb65
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/orphanedSigns.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=6 id=3001 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/removeFirstLines.expected b/vim/bundle/vim-gitgutter/test/removeFirstLines.expected
new file mode 100644
index 0000000..1cbfd76
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/removeFirstLines.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=1 id=3000 name=GitGutterLineRemovedFirstLine
diff --git a/vim/bundle/vim-gitgutter/test/removeLines.expected b/vim/bundle/vim-gitgutter/test/removeLines.expected
new file mode 100644
index 0000000..94d8ee4
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/removeLines.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=4 id=3000 name=GitGutterLineRemoved
diff --git a/vim/bundle/vim-gitgutter/test/signColumnAlways.expected b/vim/bundle/vim-gitgutter/test/signColumnAlways.expected
new file mode 100644
index 0000000..aeda456
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/signColumnAlways.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=9999 id=2999 name=GitGutterDummy
diff --git a/vim/bundle/vim-gitgutter/test/test b/vim/bundle/vim-gitgutter/test/test
new file mode 100755
index 0000000..5c2d877
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/test
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+
+VIM="/Applications/MacVim.app/Contents/MacOS/Vim -v"
+
+status=0
+
+# Execute the tests.
+for editor in "$VIM" nvim; do
+
+ for testcase in test*.vim; do
+ $editor -N -u NONE --cmd 'let g:gitgutter_async=0' -S $testcase -c 'quit!'
+
+ git reset HEAD fixture.txt > /dev/null
+ git checkout fixture.txt
+ done
+
+ # Verify the results.
+ echo "$editor:"
+ echo
+
+ count_ok=0
+ count_fail=0
+
+ for expected in *.expected; do
+ name=${expected%.*}
+ actual=$name.actual
+
+ if diff $expected $actual; then
+ count_ok=$((count_ok + 1))
+ echo "$name ok"
+ rm $actual
+ else
+ count_fail=$((count_fail + 1))
+ echo "$name failed"
+ fi
+ done
+
+ # Print results.
+ echo
+ echo "$((count_ok + count_fail)) tests"
+ echo "$count_ok ok"
+ echo "$count_fail failed"
+ echo
+
+ status=$(($status + $count_fail))
+
+done
+
+exit $status
+
diff --git a/vim/bundle/vim-gitgutter/test/testAddLines.vim b/vim/bundle/vim-gitgutter/test/testAddLines.vim
new file mode 100644
index 0000000..6b0ec4a
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testAddLines.vim
@@ -0,0 +1,6 @@
+source helper.vim
+call Setup()
+
+normal ggo*
+write
+call DumpSigns('addLines')
diff --git a/vim/bundle/vim-gitgutter/test/testAddLinesFish.vim b/vim/bundle/vim-gitgutter/test/testAddLinesFish.vim
new file mode 100644
index 0000000..f1c6bab
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testAddLinesFish.vim
@@ -0,0 +1,7 @@
+set shell=/usr/local/bin/fish
+source helper.vim
+call Setup()
+
+normal ggo*
+write
+call DumpSigns('addLinesFish')
diff --git a/vim/bundle/vim-gitgutter/test/testEditAmbiguousFile.vim b/vim/bundle/vim-gitgutter/test/testEditAmbiguousFile.vim
new file mode 100644
index 0000000..693ecf7
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testEditAmbiguousFile.vim
@@ -0,0 +1,9 @@
+source helper.vim
+call Setup()
+
+normal 5Gi*
+call system('git checkout -b fixture.txt')
+write
+call DumpSigns('ambiguousFile')
+
+call system('git checkout - && git branch -d fixture.txt')
diff --git a/vim/bundle/vim-gitgutter/test/testFileAddedToGit.vim b/vim/bundle/vim-gitgutter/test/testFileAddedToGit.vim
new file mode 100644
index 0000000..91a2c14
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testFileAddedToGit.vim
@@ -0,0 +1,12 @@
+source helper.vim
+
+let tmpfile = 'fileAddedToGit.tmp'
+call system('touch '.tmpfile)
+call system('git add '.tmpfile)
+execute 'edit '.tmpfile
+normal ihello
+write
+call DumpSigns('fileAddedToGit')
+
+call system('git reset HEAD '.tmpfile)
+call system('rm '.tmpfile)
diff --git a/vim/bundle/vim-gitgutter/test/testFilenameWithEquals.vim b/vim/bundle/vim-gitgutter/test/testFilenameWithEquals.vim
new file mode 100644
index 0000000..082ff02
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testFilenameWithEquals.vim
@@ -0,0 +1,12 @@
+source helper.vim
+
+edit =fixture=.txt
+normal ggo*
+try
+ write
+ write
+ call DumpSigns('filenameWithEquals')
+finally
+ call system('git reset HEAD =fixture=.txt')
+ call system('git checkout =fixture=.txt')
+endtry
diff --git a/vim/bundle/vim-gitgutter/test/testFilenameWithSquareBrackets.vim b/vim/bundle/vim-gitgutter/test/testFilenameWithSquareBrackets.vim
new file mode 100644
index 0000000..85ae889
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testFilenameWithSquareBrackets.vim
@@ -0,0 +1,9 @@
+source helper.vim
+
+edit fix[tu]re.txt
+normal ggo*
+write
+call DumpSigns('filenameWithSquareBrackets')
+
+call system('git reset HEAD fix[tu]re.txt')
+call system('git checkout fix[tu]re.txt')
diff --git a/vim/bundle/vim-gitgutter/test/testFollowSymlink.vim b/vim/bundle/vim-gitgutter/test/testFollowSymlink.vim
new file mode 100644
index 0000000..fda33ec
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/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)
diff --git a/vim/bundle/vim-gitgutter/test/testHunkOutsideNoop.vim b/vim/bundle/vim-gitgutter/test/testHunkOutsideNoop.vim
new file mode 100644
index 0000000..6601e6d
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testHunkOutsideNoop.vim
@@ -0,0 +1,13 @@
+source helper.vim
+call Setup()
+
+normal 5G
+
+execute 'GitGutterStageHunk'
+call DumpSigns('hunkOutsideNoopStageSigns')
+call DumpGitDiffStaged('hunkHunkOutsideNoopStageGitDiffStaged')
+
+execute 'GitGutterUndoHunk'
+call DumpSigns('hunkOutsideNoopUndoSigns')
+call DumpGitDiffStaged('hunkHunkOutsideNoopUndoGitDiffStaged')
+
diff --git a/vim/bundle/vim-gitgutter/test/testHunkStage.vim b/vim/bundle/vim-gitgutter/test/testHunkStage.vim
new file mode 100644
index 0000000..6f818fb
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testHunkStage.vim
@@ -0,0 +1,7 @@
+source helper.vim
+call Setup()
+
+normal 5Gi*
+execute 'GitGutterStageHunk'
+call DumpSigns('hunkStageSigns')
+call DumpGitDiffStaged('hunkStageGitDiff')
diff --git a/vim/bundle/vim-gitgutter/test/testHunkStageNearbyHunk.vim b/vim/bundle/vim-gitgutter/test/testHunkStageNearbyHunk.vim
new file mode 100644
index 0000000..9939103
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testHunkStageNearbyHunk.vim
@@ -0,0 +1,10 @@
+source helper.vim
+call Setup()
+
+execute "normal! 2Gox\<CR>y\<CR>z"
+normal 2jdd
+normal k
+execute 'GitGutterStageHunk'
+call DumpSigns('hunkStageNearbySigns')
+call DumpGitDiff('hunkStageNearbyGitDiff')
+call DumpGitDiffStaged('hunkStageNearbyGitDiffStaged')
diff --git a/vim/bundle/vim-gitgutter/test/testHunkUndo.vim b/vim/bundle/vim-gitgutter/test/testHunkUndo.vim
new file mode 100644
index 0000000..9d187a7
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testHunkUndo.vim
@@ -0,0 +1,7 @@
+source helper.vim
+call Setup()
+
+normal 5Gi*
+execute 'GitGutterUndoHunk'
+call DumpSigns('hunkUndoSigns')
+call DumpGitDiffStaged('hunkUndoGitDiff')
diff --git a/vim/bundle/vim-gitgutter/test/testHunkUndoNearbyHunk.vim b/vim/bundle/vim-gitgutter/test/testHunkUndoNearbyHunk.vim
new file mode 100644
index 0000000..5721f2d
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testHunkUndoNearbyHunk.vim
@@ -0,0 +1,9 @@
+source helper.vim
+call Setup()
+
+execute "normal! 2Gox\<CR>y\<CR>z"
+normal 2jdd
+normal k
+execute 'GitGutterUndoHunk'
+call DumpSigns('hunkUndoNearbySigns')
+call DumpGitDiff('hunkUndoNearbyGitDiff')
diff --git a/vim/bundle/vim-gitgutter/test/testKeepAlt.vim b/vim/bundle/vim-gitgutter/test/testKeepAlt.vim
new file mode 100644
index 0000000..303ff0f
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testKeepAlt.vim
@@ -0,0 +1,12 @@
+source helper.vim
+call Setup()
+
+enew
+execute "normal! \<C-^>"
+call Dump('buffer: '.bufname(''), 'keepAlt')
+call Dump('altbuffer: '.bufname('#'), 'keepAlt')
+
+normal ggx
+doautocmd CursorHold
+call Dump('altbuffer: '.bufname('#'), 'keepAlt')
+
diff --git a/vim/bundle/vim-gitgutter/test/testKeepModified.vim b/vim/bundle/vim-gitgutter/test/testKeepModified.vim
new file mode 100644
index 0000000..acb687f
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testKeepModified.vim
@@ -0,0 +1,8 @@
+source helper.vim
+call Setup()
+
+normal 5Go*
+call Dump("modified: ".getbufvar('', '&modified'), 'keepModified')
+doautocmd CursorHold
+call Dump("modified: ".getbufvar('', '&modified'), 'keepModified')
+
diff --git a/vim/bundle/vim-gitgutter/test/testKeepOpMarks.vim b/vim/bundle/vim-gitgutter/test/testKeepOpMarks.vim
new file mode 100644
index 0000000..1175c80
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testKeepOpMarks.vim
@@ -0,0 +1,10 @@
+source helper.vim
+call Setup()
+
+normal 5Go*
+call Dump("'[ mark: ".join(getpos("'["), ','), 'keepOpMarks')
+call Dump("'] mark: ".join(getpos("']"), ','), 'keepOpMarks')
+doautocmd CursorHold
+call Dump("'[ mark: ".join(getpos("'["), ','), 'keepOpMarks')
+call Dump("'] mark: ".join(getpos("']"), ','), 'keepOpMarks')
+
diff --git a/vim/bundle/vim-gitgutter/test/testModifyLines.vim b/vim/bundle/vim-gitgutter/test/testModifyLines.vim
new file mode 100644
index 0000000..d4a3d01
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testModifyLines.vim
@@ -0,0 +1,6 @@
+source helper.vim
+call Setup()
+
+normal ggi*
+write
+call DumpSigns('modifyLines')
diff --git a/vim/bundle/vim-gitgutter/test/testNoModifications.vim b/vim/bundle/vim-gitgutter/test/testNoModifications.vim
new file mode 100644
index 0000000..909639f
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testNoModifications.vim
@@ -0,0 +1,4 @@
+source helper.vim
+call Setup()
+
+call DumpSigns('noModifications')
diff --git a/vim/bundle/vim-gitgutter/test/testOrphanedSigns.vim b/vim/bundle/vim-gitgutter/test/testOrphanedSigns.vim
new file mode 100644
index 0000000..35992d2
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testOrphanedSigns.vim
@@ -0,0 +1,8 @@
+source helper.vim
+call Setup()
+
+execute "normal 5GoX\<CR>Y"
+write
+execute '6d'
+write
+call DumpSigns('orphanedSigns')
diff --git a/vim/bundle/vim-gitgutter/test/testRemoveFirstLines.vim b/vim/bundle/vim-gitgutter/test/testRemoveFirstLines.vim
new file mode 100644
index 0000000..4a29a73
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testRemoveFirstLines.vim
@@ -0,0 +1,6 @@
+source helper.vim
+call Setup()
+
+execute '1d'
+write
+call DumpSigns('removeFirstLines')
diff --git a/vim/bundle/vim-gitgutter/test/testRemoveLines.vim b/vim/bundle/vim-gitgutter/test/testRemoveLines.vim
new file mode 100644
index 0000000..23d672b
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testRemoveLines.vim
@@ -0,0 +1,6 @@
+source helper.vim
+call Setup()
+
+execute '5d'
+write
+call DumpSigns('removeLines')
diff --git a/vim/bundle/vim-gitgutter/test/testSignColumnAlways.vim b/vim/bundle/vim-gitgutter/test/testSignColumnAlways.vim
new file mode 100644
index 0000000..ff3eb94
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testSignColumnAlways.vim
@@ -0,0 +1,7 @@
+source helper.vim
+call Setup()
+
+let g:gitgutter_sign_column_always=1
+write
+
+call DumpSigns('signColumnAlways')
diff --git a/vim/bundle/vim-gitgutter/test/testUntrackedFileOutsideRepo.vim b/vim/bundle/vim-gitgutter/test/testUntrackedFileOutsideRepo.vim
new file mode 100644
index 0000000..f473d35
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testUntrackedFileOutsideRepo.vim
@@ -0,0 +1,6 @@
+source helper.vim
+
+let tmpfile = tempname()
+call system('touch '.tmpfile)
+execute 'edit '.tmpfile
+call DumpSigns('untrackedFileOutsideRepo')
diff --git a/vim/bundle/vim-gitgutter/test/testUntrackedFileSquareBracketsWithinRepo.vim b/vim/bundle/vim-gitgutter/test/testUntrackedFileSquareBracketsWithinRepo.vim
new file mode 100644
index 0000000..b1fd48a
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testUntrackedFileSquareBracketsWithinRepo.vim
@@ -0,0 +1,10 @@
+source helper.vim
+
+let tmpfile = '[un]trackedFileWithinRepo.tmp'
+call system('touch '.tmpfile)
+execute 'edit '.tmpfile
+normal ggo*
+doautocmd CursorHold
+call DumpSigns('untrackedFileSquareBracketsWithinRepo')
+
+call system('rm '.tmpfile)
diff --git a/vim/bundle/vim-gitgutter/test/testUntrackedFileWithinRepo.vim b/vim/bundle/vim-gitgutter/test/testUntrackedFileWithinRepo.vim
new file mode 100644
index 0000000..4fdd48e
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testUntrackedFileWithinRepo.vim
@@ -0,0 +1,10 @@
+source helper.vim
+
+let tmpfile = 'untrackedFileWithinRepo.tmp'
+call system('touch '.tmpfile)
+execute 'edit '.tmpfile
+normal ggo*
+doautocmd CursorHold
+call DumpSigns('untrackedFileWithinRepo')
+
+call system('rm '.tmpfile)
diff --git a/vim/bundle/vim-gitgutter/test/untrackedFileOutsideRepo.expected b/vim/bundle/vim-gitgutter/test/untrackedFileOutsideRepo.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/untrackedFileOutsideRepo.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/untrackedFileSquareBracketsWithinRepo.expected b/vim/bundle/vim-gitgutter/test/untrackedFileSquareBracketsWithinRepo.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/untrackedFileSquareBracketsWithinRepo.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/untrackedFileWithinRepo.expected b/vim/bundle/vim-gitgutter/test/untrackedFileWithinRepo.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/untrackedFileWithinRepo.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---