0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.1786: various Normal mode commands not fully tested

Problem:    Various Normal mode commands not fully tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes #7059)
This commit is contained in:
Bram Moolenaar
2020-10-02 18:48:07 +02:00
parent 3f974ff45e
commit 8a9bc95eae
7 changed files with 206 additions and 28 deletions

View File

@@ -370,14 +370,17 @@ endfunc
func Test_Visual_paragraph_textobject()
new
call setline(1, ['First line.',
\ '',
\ 'Second line.',
\ 'Third line.',
\ 'Fourth line.',
\ 'Fifth line.',
\ '',
\ 'Sixth line.'])
let lines =<< trim [END]
First line.
Second line.
Third line.
Fourth line.
Fifth line.
Sixth line.
[END]
call setline(1, lines)
" When start and end of visual area are identical, 'ap' or 'ip' select
" the whole paragraph.
@@ -633,6 +636,20 @@ func Test_characterwise_visual_mode()
normal Gkvj$d
call assert_equal(['', 'a', ''], getline(1, '$'))
" characterwise visual mode: use a count with the visual mode
%d _
call setline(1, 'one two three')
norm! vy5vy
call assert_equal('one t', @")
" characterwise visual mode: use a count with the visual mode from the last
" line in the buffer
%d _
call setline(1, ['one', 'two', 'three', 'four'])
norm! vj$y
norm! G1vy
call assert_equal('four', @")
bwipe!
endfunc