mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Add test for staging subsequent nearby hunk.
This commit is contained in:
@@ -12,6 +12,11 @@ function! DumpSigns(filename)
|
||||
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
|
||||
|
||||
|
||||
13
test/hunkStageNearbyGitDiff.expected
Normal file
13
test/hunkStageNearbyGitDiff.expected
Normal file
@@ -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
|
||||
12
test/hunkStageNearbyGitDiffStaged.expected
Normal file
12
test/hunkStageNearbyGitDiffStaged.expected
Normal file
@@ -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
|
||||
6
test/hunkStageNearbySigns.expected
Normal file
6
test/hunkStageNearbySigns.expected
Normal file
@@ -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
|
||||
10
test/testHunkStageNearbyHunk.vim
Normal file
10
test/testHunkStageNearbyHunk.vim
Normal file
@@ -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')
|
||||
Reference in New Issue
Block a user