diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-07-20 08:16:02 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-08-15 20:24:43 +0800 |
| commit | 76b4b1977ba3f3a1f630468a2ce89f47f2cedec4 (patch) | |
| tree | 7d899e1d86a5e939c231ee18e66f4cea9bd7aa5a /src/nvim/testdir/test_visual.vim | |
| parent | 37586eac42b285b97e6b85e736750c4f15df068d (diff) | |
| download | rneovim-76b4b1977ba3f3a1f630468a2ce89f47f2cedec4.tar.gz rneovim-76b4b1977ba3f3a1f630468a2ce89f47f2cedec4.tar.bz2 rneovim-76b4b1977ba3f3a1f630468a2ce89f47f2cedec4.zip | |
vim-patch:8.2.1799: some Normal mode commands not fully tested
Problem: Some Normal mode commands not fully tested.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#7073)
https://github.com/vim/vim/commit/d1ad99b65470d3e754f6a0588a6b0dc2214a1eab
Cherry-pick test_registers.vim change from patch 8.2.0644.
Diffstat (limited to 'src/nvim/testdir/test_visual.vim')
| -rw-r--r-- | src/nvim/testdir/test_visual.vim | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim index 0a12b3570a..456f0e0edd 100644 --- a/src/nvim/testdir/test_visual.vim +++ b/src/nvim/testdir/test_visual.vim @@ -642,12 +642,6 @@ 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 _ @@ -1195,15 +1189,38 @@ func Test_exclusive_selection() close! endfunc -" Test for starting visual mode with a count. -" This test should be run without any previous visual modes. So this should be -" run as a first test. -func Test_AAA_start_visual_mode_with_count() - new - call setline(1, ['aaaaaaa', 'aaaaaaa', 'aaaaaaa', 'aaaaaaa']) - normal! gg2Vy - call assert_equal("aaaaaaa\naaaaaaa\n", @") - close! +" Test for starting linewise visual with a count. +" This test needs to be run without any previous visual mode. Otherwise the +" count will use the count from the previous visual mode. +func Test_linewise_visual_with_count() + let after =<< trim [CODE] + call setline(1, ['one', 'two', 'three', 'four']) + norm! 3Vy + call assert_equal("one\ntwo\nthree\n", @") + call writefile(v:errors, 'Xtestout') + qall! + [CODE] + if RunVim([], after, '') + call assert_equal([], readfile('Xtestout')) + call delete('Xtestout') + endif +endfunc + +" Test for starting characterwise visual with a count. +" This test needs to be run without any previous visual mode. Otherwise the +" count will use the count from the previous visual mode. +func Test_characterwise_visual_with_count() + let after =<< trim [CODE] + call setline(1, ['one two', 'three']) + norm! l5vy + call assert_equal("ne tw", @") + call writefile(v:errors, 'Xtestout') + qall! + [CODE] + if RunVim([], after, '') + call assert_equal([], readfile('Xtestout')) + call delete('Xtestout') + endif endfunc " Test for visually selecting an inner block (iB) |