mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Add tests for text objects.
This commit is contained in:
@@ -437,3 +437,39 @@ function Test_write_option()
|
||||
|
||||
set write
|
||||
endfunction
|
||||
|
||||
|
||||
function Test_inner_text_object()
|
||||
execute "normal! 2Gox\<CR>y\<CR>z\<CR>\<CR>"
|
||||
doautocmd CursorHold
|
||||
normal dic
|
||||
doautocmd CursorHold
|
||||
|
||||
call assert_equal([], s:signs('fixture.txt'))
|
||||
call assert_equal(readfile('fixture.txt'), getline(1,'$'))
|
||||
|
||||
" Excludes trailing lines
|
||||
normal 9Gi*
|
||||
normal 10Gi*
|
||||
doautocmd CursorHold
|
||||
execute "normal vic\<Esc>"
|
||||
call assert_equal([9, 10], [line("'<"), line("'>")])
|
||||
endfunction
|
||||
|
||||
|
||||
function Test_around_text_object()
|
||||
execute "normal! 2Gox\<CR>y\<CR>z\<CR>\<CR>"
|
||||
doautocmd CursorHold
|
||||
normal dac
|
||||
doautocmd CursorHold
|
||||
|
||||
call assert_equal([], s:signs('fixture.txt'))
|
||||
call assert_equal(readfile('fixture.txt'), getline(1,'$'))
|
||||
|
||||
" Includes trailing lines
|
||||
normal 9Gi*
|
||||
normal 10Gi*
|
||||
doautocmd CursorHold
|
||||
execute "normal vac\<Esc>"
|
||||
call assert_equal([9, 11], [line("'<"), line("'>")])
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user