From 314f1a7c2168ee7e99e2d2b348146df092341a64 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 13 Jul 2022 13:47:01 +0800 Subject: vim-patch:8.2.0369: various Normal mode commands not fully tested Problem: Various Normal mode commands not fully tested. Solution: Add more tests. (Yegappan Lakshmanan, closes vim/vim#5751) https://github.com/vim/vim/commit/1671f4488105ee12a6a8558ae351436c26ab55fc Cherry-pick a fix from patch 8.2.3162. Omit test_iminsert.vim as previous patches to that file are N/A, and Nvim doesn't support iminsert=2 either, so that test isn't useful. --- src/nvim/testdir/test_marks.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/nvim/testdir/test_marks.vim') diff --git a/src/nvim/testdir/test_marks.vim b/src/nvim/testdir/test_marks.vim index 608f9883c2..8f94224128 100644 --- a/src/nvim/testdir/test_marks.vim +++ b/src/nvim/testdir/test_marks.vim @@ -215,6 +215,7 @@ func Test_mark_error() call assert_fails('mark', 'E471:') call assert_fails('mark xx', 'E488:') call assert_fails('mark _', 'E191:') + call assert_beeps('normal! m~') endfunc " Test for :lockmarks when pasting content @@ -241,6 +242,29 @@ func Test_marks_k_cmd() close! endfunc +" Test for file marks (A-Z) +func Test_file_mark() + new Xone + call setline(1, ['aaa', 'bbb']) + norm! G$mB + w! + new Xtwo + call setline(1, ['ccc', 'ddd']) + norm! GmD + w! + + enew + normal! `B + call assert_equal('Xone', bufname()) + call assert_equal([2, 3], [line('.'), col('.')]) + normal! 'D + call assert_equal('Xtwo', bufname()) + call assert_equal([2, 1], [line('.'), col('.')]) + + call delete('Xone') + call delete('Xtwo') +endfunc + " Test for the getmarklist() function func Test_getmarklist() new -- cgit