mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Add test for hunk staging.
This commit is contained in:
@@ -2,6 +2,7 @@ set runtimepath+=../
|
|||||||
source ../plugin/gitgutter.vim
|
source ../plugin/gitgutter.vim
|
||||||
|
|
||||||
function! Setup()
|
function! Setup()
|
||||||
|
call system('git reset HEAD fixture.txt')
|
||||||
call system('git checkout fixture.txt')
|
call system('git checkout fixture.txt')
|
||||||
edit! fixture.txt
|
edit! fixture.txt
|
||||||
sign unplace *
|
sign unplace *
|
||||||
@@ -13,3 +14,6 @@ function! DumpSigns(filename)
|
|||||||
redir END
|
redir END
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! DumpGitDiff(filename)
|
||||||
|
call system('git diff --staged fixture.txt > '.a:filename.'.out')
|
||||||
|
endfunction
|
||||||
|
|||||||
13
test/hunkStageGitDiff.ok
Normal file
13
test/hunkStageGitDiff.ok
Normal file
@@ -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
|
||||||
2
test/hunkStageSigns.ok
Normal file
2
test/hunkStageSigns.ok
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
--- Signs ---
|
||||||
7
test/testHunkStage.vim
Normal file
7
test/testHunkStage.vim
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
source helper.vim
|
||||||
|
call Setup()
|
||||||
|
|
||||||
|
normal 5Gi*
|
||||||
|
execute 'GitGutterStageHunk'
|
||||||
|
call DumpSigns('hunkStageSigns')
|
||||||
|
call DumpGitDiff('hunkStageGitDiff')
|
||||||
Reference in New Issue
Block a user