From f9d84e8b9f4f28de7494abeb924a24b0720eef1d Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Tue, 18 Jul 2023 20:12:36 +0200 Subject: [PATCH] Add a test --- src/testdir/test_normal.vim | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index a3d9454d2c01ec..9596f8ef60c600 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -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\\" + call assert_equal(['This is a simple test: abc', ''], getline(1,'$')) + exe "norm! 1gg$hr\\" + call assert_equal(['This is a simple test: ab', ''], getline(1,'$')) + exe "norm! 1gg$2hr\x7e" + call assert_equal(['This is a simple test: a~', ''], getline(1,'$')) + exe "norm! 1gg$3hr\x7e" + call assert_equal(['This is a simple test: ~~', ''], getline(1,'$')) + + if &encoding == 'utf-8' + exe "norm! 1gg$4hr\u20ac" + call assert_equal(['This is a simple test:€~~', ''], getline(1,'$')) + exe "norm! 1gg$5hr\u20ac" + call assert_equal(['This is a simple test€€~~', ''], getline(1,'$')) + exe "norm! 1gg0R\xff WAS \" + call assert_equal(['ÿ WAS a simple test€€~~', ''], getline(1,'$')) + exe "norm! 1gg0elR\xffNOT\" + call assert_equal(['ÿ WASÿNOT simple test€€~~', ''], getline(1,'$')) + endif + + + " clean up + bw! +endfunc + " vim: shiftwidth=2 sts=2 expandtab