mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.0655: search code not sufficiently tested
Problem: Search code not sufficiently tested. Solution: Add more tests. (Yegappan Lakshmanan, closes #5999)
This commit is contained in:
@@ -890,4 +890,27 @@ func Test_AAA_start_visual_mode_with_count()
|
||||
close!
|
||||
endfunc
|
||||
|
||||
" Test for visually selecting an inner block (iB)
|
||||
func Test_visual_inner_block()
|
||||
new
|
||||
call setline(1, ['one', '{', 'two', '{', 'three', '}', 'four', '}', 'five'])
|
||||
call cursor(5, 1)
|
||||
" visually select all the lines in the block and then execute iB
|
||||
call feedkeys("ViB\<C-C>", 'xt')
|
||||
call assert_equal([0, 5, 1, 0], getpos("'<"))
|
||||
call assert_equal([0, 5, 6, 0], getpos("'>"))
|
||||
" visually select two inner blocks
|
||||
call feedkeys("ViBiB\<C-C>", 'xt')
|
||||
call assert_equal([0, 3, 1, 0], getpos("'<"))
|
||||
call assert_equal([0, 7, 5, 0], getpos("'>"))
|
||||
" try to select non-existing inner block
|
||||
call cursor(5, 1)
|
||||
call assert_beeps('normal ViBiBiB')
|
||||
" try to select a unclosed inner block
|
||||
8,9d
|
||||
call cursor(5, 1)
|
||||
call assert_beeps('normal ViBiB')
|
||||
close!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Reference in New Issue
Block a user