Mercurial > vim
diff src/testdir/test_normal.vim @ 12788:cb9b2774f21f v8.0.1271
patch 8.0.1271: still too many old style tests
commit https://github.com/vim/vim/commit/fb094e14c19337de824d4e6710ca6a2617930ab0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 5 20:59:28 2017 +0100
patch 8.0.1271: still too many old style tests
Problem: Still too many old style tests.
Solution: Convert a few more tests to new style. (Yegappan Lakshmanan,
closes #2290)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 05 Nov 2017 21:00:04 +0100 |
parents | 6fa9f6b4d159 |
children | 4d2ee1564c97 |
line wrap: on
line diff
--- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -2396,3 +2396,45 @@ func Test_delete_until_paragraph() call assert_equal('', getline(1)) bwipe! endfunc + +" Test for the gr (virtual replace) command +" Test for the bug fixed by 7.4.387 +func Test_gr_command() + enew! + let save_cpo = &cpo + call append(0, ['First line', 'Second line', 'Third line']) + exe "normal i\<C-G>u" + call cursor(2, 1) + set cpo-=X + normal 4gro + call assert_equal('oooond line', getline(2)) + undo + set cpo+=X + normal 4gro + call assert_equal('ooooecond line', getline(2)) + let &cpo = save_cpo + enew! +endfunc + +" When splitting a window the changelist position is wrong. +" Test the changelist position after splitting a window. +" Test for the bug fixed by 7.4.386 +func Test_changelist() + let save_ul = &ul + enew! + call append('$', ['1', '2']) + exe "normal i\<C-G>u" + exe "normal Gkylpa\<C-G>u" + set ul=100 + exe "normal Gylpa\<C-G>u" + set ul=100 + normal gg + vsplit + normal g; + call assert_equal([3, 2], [line('.'), col('.')]) + normal g; + call assert_equal([2, 2], [line('.'), col('.')]) + call assert_fails('normal g;', 'E662:') + %bwipe! + let &ul = save_ul +endfunc