0
0
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:
Bram Moolenaar
2020-04-28 20:29:07 +02:00
parent a14bb7e113
commit 224a5f17c6
10 changed files with 551 additions and 103 deletions

View File

@@ -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