0
0
mirror of https://github.com/vim/vim.git synced 2025-10-18 07:54:29 -04:00

patch 8.2.0968: no proper testing of the 'cpoptions' flags

Problem:    No proper testing of the 'cpoptions' flags.
Solution:   Add tests. (Yegappan Lakshmanan, closes #6251)
This commit is contained in:
Bram Moolenaar
2020-06-13 13:20:48 +02:00
parent 71ccd03ee8
commit c9630d2658
5 changed files with 631 additions and 110 deletions

View File

@@ -1574,37 +1574,4 @@ func Test_edit_ctrl_o_invalid_cmd()
close!
endfunc
" Test for inserting text in a line with only spaces ('H' flag in 'cpoptions')
func Test_edit_cpo_H()
new
call setline(1, ' ')
normal! Ia
call assert_equal(' a', getline(1))
set cpo+=H
call setline(1, ' ')
normal! Ia
call assert_equal(' a ', getline(1))
set cpo-=H
close!
endfunc
" Test for inserting tab in virtual replace mode ('L' flag in 'cpoptions')
func Test_edit_cpo_L()
new
call setline(1, 'abcdefghijklmnopqr')
exe "normal 0gR\<Tab>"
call assert_equal("\<Tab>ijklmnopqr", getline(1))
set cpo+=L
set list
call setline(1, 'abcdefghijklmnopqr')
exe "normal 0gR\<Tab>"
call assert_equal("\<Tab>cdefghijklmnopqr", getline(1))
set nolist
call setline(1, 'abcdefghijklmnopqr')
exe "normal 0gR\<Tab>"
call assert_equal("\<Tab>ijklmnopqr", getline(1))
set cpo-=L
%bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab