From e573b3020c032400eed60b649a2cbf55266e6bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Jun 2016 16:03:25 +0200 Subject: Add current configurations from old repository --- vim/bundle/vim-gitgutter/test/=fixture=.txt | 0 vim/bundle/vim-gitgutter/test/README.markdown | 30 +++++++++++++ vim/bundle/vim-gitgutter/test/addLines.expected | 4 ++ .../vim-gitgutter/test/addLinesFish.expected | 4 ++ .../vim-gitgutter/test/ambiguousFile.expected | 4 ++ .../vim-gitgutter/test/fileAddedToGit.expected | 4 ++ .../vim-gitgutter/test/filenameWithEquals.expected | 5 +++ .../test/filenameWithSquareBrackets.expected | 5 +++ vim/bundle/vim-gitgutter/test/fix[tu]re.txt | 0 vim/bundle/vim-gitgutter/test/fixture.txt | 11 +++++ .../vim-gitgutter/test/followSymlink.expected | 4 ++ vim/bundle/vim-gitgutter/test/helper.vim | 27 ++++++++++++ .../hunkHunkOutsideNoopStageGitDiffStaged.expected | 0 .../hunkHunkOutsideNoopUndoGitDiffStaged.expected | 0 .../test/hunkOutsideNoopStageSigns.expected | 2 + .../test/hunkOutsideNoopUndoSigns.expected | 2 + .../vim-gitgutter/test/hunkStageGitDiff.expected | 13 ++++++ .../test/hunkStageNearbyGitDiff.expected | 13 ++++++ .../test/hunkStageNearbyGitDiffStaged.expected | 12 ++++++ .../test/hunkStageNearbySigns.expected | 6 +++ .../vim-gitgutter/test/hunkStageSigns.expected | 2 + .../vim-gitgutter/test/hunkUndoGitDiff.expected | 0 .../test/hunkUndoNearbyGitDiff.expected | 13 ++++++ .../test/hunkUndoNearbySigns.expected | 6 +++ .../vim-gitgutter/test/hunkUndoSigns.expected | 2 + vim/bundle/vim-gitgutter/test/keepAlt.expected | 3 ++ .../vim-gitgutter/test/keepModified.expected | 2 + vim/bundle/vim-gitgutter/test/keepOpMarks.expected | 4 ++ vim/bundle/vim-gitgutter/test/modifyLines.expected | 4 ++ .../vim-gitgutter/test/noModifications.expected | 2 + .../vim-gitgutter/test/orphanedSigns.expected | 4 ++ .../vim-gitgutter/test/removeFirstLines.expected | 4 ++ vim/bundle/vim-gitgutter/test/removeLines.expected | 4 ++ .../vim-gitgutter/test/signColumnAlways.expected | 4 ++ vim/bundle/vim-gitgutter/test/test | 50 ++++++++++++++++++++++ vim/bundle/vim-gitgutter/test/testAddLines.vim | 6 +++ vim/bundle/vim-gitgutter/test/testAddLinesFish.vim | 7 +++ .../vim-gitgutter/test/testEditAmbiguousFile.vim | 9 ++++ .../vim-gitgutter/test/testFileAddedToGit.vim | 12 ++++++ .../vim-gitgutter/test/testFilenameWithEquals.vim | 12 ++++++ .../test/testFilenameWithSquareBrackets.vim | 9 ++++ .../vim-gitgutter/test/testFollowSymlink.vim | 10 +++++ .../vim-gitgutter/test/testHunkOutsideNoop.vim | 13 ++++++ vim/bundle/vim-gitgutter/test/testHunkStage.vim | 7 +++ .../vim-gitgutter/test/testHunkStageNearbyHunk.vim | 10 +++++ vim/bundle/vim-gitgutter/test/testHunkUndo.vim | 7 +++ .../vim-gitgutter/test/testHunkUndoNearbyHunk.vim | 9 ++++ vim/bundle/vim-gitgutter/test/testKeepAlt.vim | 12 ++++++ vim/bundle/vim-gitgutter/test/testKeepModified.vim | 8 ++++ vim/bundle/vim-gitgutter/test/testKeepOpMarks.vim | 10 +++++ vim/bundle/vim-gitgutter/test/testModifyLines.vim | 6 +++ .../vim-gitgutter/test/testNoModifications.vim | 4 ++ .../vim-gitgutter/test/testOrphanedSigns.vim | 8 ++++ .../vim-gitgutter/test/testRemoveFirstLines.vim | 6 +++ vim/bundle/vim-gitgutter/test/testRemoveLines.vim | 6 +++ .../vim-gitgutter/test/testSignColumnAlways.vim | 7 +++ .../test/testUntrackedFileOutsideRepo.vim | 6 +++ .../testUntrackedFileSquareBracketsWithinRepo.vim | 10 +++++ .../test/testUntrackedFileWithinRepo.vim | 10 +++++ .../test/untrackedFileOutsideRepo.expected | 2 + .../untrackedFileSquareBracketsWithinRepo.expected | 2 + .../test/untrackedFileWithinRepo.expected | 2 + 62 files changed, 460 insertions(+) create mode 100644 vim/bundle/vim-gitgutter/test/=fixture=.txt create mode 100644 vim/bundle/vim-gitgutter/test/README.markdown create mode 100644 vim/bundle/vim-gitgutter/test/addLines.expected create mode 100644 vim/bundle/vim-gitgutter/test/addLinesFish.expected create mode 100644 vim/bundle/vim-gitgutter/test/ambiguousFile.expected create mode 100644 vim/bundle/vim-gitgutter/test/fileAddedToGit.expected create mode 100644 vim/bundle/vim-gitgutter/test/filenameWithEquals.expected create mode 100644 vim/bundle/vim-gitgutter/test/filenameWithSquareBrackets.expected create mode 100644 vim/bundle/vim-gitgutter/test/fix[tu]re.txt create mode 100644 vim/bundle/vim-gitgutter/test/fixture.txt create mode 100644 vim/bundle/vim-gitgutter/test/followSymlink.expected create mode 100644 vim/bundle/vim-gitgutter/test/helper.vim create mode 100644 vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopStageGitDiffStaged.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopUndoGitDiffStaged.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkOutsideNoopStageSigns.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkOutsideNoopUndoSigns.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkStageGitDiff.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiff.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiffStaged.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkStageNearbySigns.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkStageSigns.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkUndoGitDiff.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkUndoNearbyGitDiff.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkUndoNearbySigns.expected create mode 100644 vim/bundle/vim-gitgutter/test/hunkUndoSigns.expected create mode 100644 vim/bundle/vim-gitgutter/test/keepAlt.expected create mode 100644 vim/bundle/vim-gitgutter/test/keepModified.expected create mode 100644 vim/bundle/vim-gitgutter/test/keepOpMarks.expected create mode 100644 vim/bundle/vim-gitgutter/test/modifyLines.expected create mode 100644 vim/bundle/vim-gitgutter/test/noModifications.expected create mode 100644 vim/bundle/vim-gitgutter/test/orphanedSigns.expected create mode 100644 vim/bundle/vim-gitgutter/test/removeFirstLines.expected create mode 100644 vim/bundle/vim-gitgutter/test/removeLines.expected create mode 100644 vim/bundle/vim-gitgutter/test/signColumnAlways.expected create mode 100755 vim/bundle/vim-gitgutter/test/test create mode 100644 vim/bundle/vim-gitgutter/test/testAddLines.vim create mode 100644 vim/bundle/vim-gitgutter/test/testAddLinesFish.vim create mode 100644 vim/bundle/vim-gitgutter/test/testEditAmbiguousFile.vim create mode 100644 vim/bundle/vim-gitgutter/test/testFileAddedToGit.vim create mode 100644 vim/bundle/vim-gitgutter/test/testFilenameWithEquals.vim create mode 100644 vim/bundle/vim-gitgutter/test/testFilenameWithSquareBrackets.vim create mode 100644 vim/bundle/vim-gitgutter/test/testFollowSymlink.vim create mode 100644 vim/bundle/vim-gitgutter/test/testHunkOutsideNoop.vim create mode 100644 vim/bundle/vim-gitgutter/test/testHunkStage.vim create mode 100644 vim/bundle/vim-gitgutter/test/testHunkStageNearbyHunk.vim create mode 100644 vim/bundle/vim-gitgutter/test/testHunkUndo.vim create mode 100644 vim/bundle/vim-gitgutter/test/testHunkUndoNearbyHunk.vim create mode 100644 vim/bundle/vim-gitgutter/test/testKeepAlt.vim create mode 100644 vim/bundle/vim-gitgutter/test/testKeepModified.vim create mode 100644 vim/bundle/vim-gitgutter/test/testKeepOpMarks.vim create mode 100644 vim/bundle/vim-gitgutter/test/testModifyLines.vim create mode 100644 vim/bundle/vim-gitgutter/test/testNoModifications.vim create mode 100644 vim/bundle/vim-gitgutter/test/testOrphanedSigns.vim create mode 100644 vim/bundle/vim-gitgutter/test/testRemoveFirstLines.vim create mode 100644 vim/bundle/vim-gitgutter/test/testRemoveLines.vim create mode 100644 vim/bundle/vim-gitgutter/test/testSignColumnAlways.vim create mode 100644 vim/bundle/vim-gitgutter/test/testUntrackedFileOutsideRepo.vim create mode 100644 vim/bundle/vim-gitgutter/test/testUntrackedFileSquareBracketsWithinRepo.vim create mode 100644 vim/bundle/vim-gitgutter/test/testUntrackedFileWithinRepo.vim create mode 100644 vim/bundle/vim-gitgutter/test/untrackedFileOutsideRepo.expected create mode 100644 vim/bundle/vim-gitgutter/test/untrackedFileSquareBracketsWithinRepo.expected create mode 100644 vim/bundle/vim-gitgutter/test/untrackedFileWithinRepo.expected (limited to 'vim/bundle/vim-gitgutter/test') 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 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 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 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 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 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\y\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\y\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! \" +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\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 --- -- cgit v1.2.3