Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Jul 18, 2023
1 parent 033c44c commit f9d84e8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/testdir/test_normal.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3998,4 +3998,33 @@ func Test_normal_j_below_botline()
call StopVimInTerminal(buf)
endfunc

" Test for r (replace) command with CTRL_V and CTRL_Q
func Test_normal_r_ctrl_v_cmd()
new
call append(0, 'This is a simple test: abcd')
exe "norm! 1gg$r\<C-V>\<C-V>"
call assert_equal(['This is a simple test: abc', ''], getline(1,'$'))
exe "norm! 1gg$hr\<C-Q>\<C-Q>"
call assert_equal(['This is a simple test: ab', ''], getline(1,'$'))
exe "norm! 1gg$2hr\<C-V>x7e"
call assert_equal(['This is a simple test: a~', ''], getline(1,'$'))
exe "norm! 1gg$3hr\<C-Q>x7e"
call assert_equal(['This is a simple test: ~~', ''], getline(1,'$'))

if &encoding == 'utf-8'
exe "norm! 1gg$4hr\<C-V>u20ac"
call assert_equal(['This is a simple test:€~~', ''], getline(1,'$'))
exe "norm! 1gg$5hr\<C-Q>u20ac"
call assert_equal(['This is a simple test€€~~', ''], getline(1,'$'))
exe "norm! 1gg0R\<C-V>xff WAS \<esc>"
call assert_equal(['ÿ WAS a simple test€€~~', ''], getline(1,'$'))
exe "norm! 1gg0elR\<C-Q>xffNOT\<esc>"
call assert_equal(['ÿ WASÿNOT simple test€€~~', ''], getline(1,'$'))
endif


" clean up
bw!
endfunc

" vim: shiftwidth=2 sts=2 expandtab

0 comments on commit f9d84e8

Please sign in to comment.