aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_edit.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-12 08:28:56 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-07-12 14:08:34 +0800
commitd079995fb81bf3d61f7698373442f61476b99fce (patch)
tree27df065f0a9d2b58d90ad17a4cdea751a0b12156 /src/nvim/testdir/test_edit.vim
parent6a670a00b3553a3ad87ddc6dfd06725796f58f1e (diff)
downloadrneovim-d079995fb81bf3d61f7698373442f61476b99fce.tar.gz
rneovim-d079995fb81bf3d61f7698373442f61476b99fce.tar.bz2
rneovim-d079995fb81bf3d61f7698373442f61476b99fce.zip
vim-patch:8.2.0270: some code not covered by tests
Problem: Some code not covered by tests. Solution: Add test cases. (Yegappan Lakshmanan, closes vim/vim#5649) https://github.com/vim/vim/commit/bc2b71d44a0b90b6aeb3534a76912fccbe5577df
Diffstat (limited to 'src/nvim/testdir/test_edit.vim')
-rw-r--r--src/nvim/testdir/test_edit.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim
index 19b088959b..3ae9163861 100644
--- a/src/nvim/testdir/test_edit.vim
+++ b/src/nvim/testdir/test_edit.vim
@@ -1617,6 +1617,22 @@ func Test_edit_startinsert()
bwipe!
endfunc
+" Test for :startreplace and :startgreplace
+func Test_edit_startreplace()
+ new
+ call setline(1, 'abc')
+ call feedkeys("l:startreplace\<CR>xyz\e", 'xt')
+ call assert_equal('axyz', getline(1))
+ call feedkeys("0:startreplace!\<CR>abc\e", 'xt')
+ call assert_equal('axyzabc', getline(1))
+ call setline(1, "a\tb")
+ call feedkeys("0l:startgreplace\<CR>xyz\e", 'xt')
+ call assert_equal("axyz\tb", getline(1))
+ call feedkeys("0i\<C-R>=execute('startreplace')\<CR>12\e", 'xt')
+ call assert_equal("12axyz\tb", getline(1))
+ close!
+endfunc
+
func Test_edit_noesckeys()
CheckNotGui
new