comparison src/testdir/test_cpoptions.vim @ 20941:505d97ea54da v8.2.1022

patch 8.2.1022: various parts of code not covered by tests Commit: https://github.com/vim/vim/commit/845e0ee59430eac07e74b6cb92020e420d17953d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 20 16:05:32 2020 +0200 patch 8.2.1022: various parts of code not covered by tests Problem: Various parts of code not covered by tests. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/6300)
author Bram Moolenaar <Bram@vim.org>
date Sat, 20 Jun 2020 16:15:04 +0200
parents d3fa0d29fa9a
children 6a4806e326dd
comparison
equal deleted inserted replaced
20940:88ce5327f213 20941:505d97ea54da
244 close! 244 close!
245 let &cpo = save_cpo 245 let &cpo = save_cpo
246 endfunc 246 endfunc
247 247
248 " TODO: Add a test for the 'i' flag in 'cpo' 248 " TODO: Add a test for the 'i' flag in 'cpo'
249 " Interrupting the reading of a file will leave it modified.
249 250
250 " Test for the 'I' flag in 'cpo' (deleting autoindent when using arrow keys) 251 " Test for the 'I' flag in 'cpo' (deleting autoindent when using arrow keys)
251 func Test_cpo_I() 252 func Test_cpo_I()
252 let save_cpo = &cpo 253 let save_cpo = &cpo
253 new 254 new
292 endfor 293 endfor
293 close! 294 close!
294 let &cpo = save_cpo 295 let &cpo = save_cpo
295 endfunc 296 endfunc
296 297
297 " TODO: Add a test for the 'k' flag in 'cpo' 298 " TODO: Add a test for the 'k' flag in 'cpo'.
298 299 " Disable the recognition of raw key codes in mappings, abbreviations, and the
299 " TODO: Add a test for the 'K' flag in 'cpo' 300 " "to" part of menu commands.
301
302 " TODO: Add a test for the 'K' flag in 'cpo'.
303 " Don't wait for a key code to complete when it is halfway a mapping.
300 304
301 " Test for the 'l' flag in 'cpo' (backslash in a [] range) 305 " Test for the 'l' flag in 'cpo' (backslash in a [] range)
302 func Test_cpo_l() 306 func Test_cpo_l()
303 let save_cpo = &cpo 307 let save_cpo = &cpo
304 new 308 new
332 call assert_equal("\<Tab>ijklmnopqr", getline(1)) 336 call assert_equal("\<Tab>ijklmnopqr", getline(1))
333 close! 337 close!
334 let &cpo = save_cpo 338 let &cpo = save_cpo
335 endfunc 339 endfunc
336 340
337 " TODO: Add a test for the 'm' flag in 'cpo' 341 " TODO: Add a test for the 'm' flag in 'cpo'.
342 " When included, a showmatch will always wait half a second. When not
343 " included, a showmatch will wait half a second or until a character is typed.
338 344
339 " Test for the 'M' flag in 'cpo' (% with escape parenthesis) 345 " Test for the 'M' flag in 'cpo' (% with escape parenthesis)
340 func Test_cpo_M() 346 func Test_cpo_M()
341 let save_cpo = &cpo 347 let save_cpo = &cpo
342 new 348 new
496 call assert_equal(0, line("'r")) 502 call assert_equal(0, line("'r"))
497 close! 503 close!
498 let &cpo = save_cpo 504 let &cpo = save_cpo
499 endfunc 505 endfunc
500 506
501 " TODO: Add a test for the 's' flag in 'cpo' 507 " TODO: Add a test for the 's' flag in 'cpo'.
508 " Set buffer options when entering the buffer for the first time. If not
509 " present the options are set when the buffer is created.
502 510
503 " Test for the 'S' flag in 'cpo' (copying buffer options) 511 " Test for the 'S' flag in 'cpo' (copying buffer options)
504 func Test_cpo_S() 512 func Test_cpo_S()
505 let save_cpo = &cpo 513 let save_cpo = &cpo
506 new Xfile1 514 new Xfile1
541 call assert_equal('abcdefghi', getline(1)) 549 call assert_equal('abcdefghi', getline(1))
542 close! 550 close!
543 let &cpo = save_cpo 551 let &cpo = save_cpo
544 endfunc 552 endfunc
545 553
546 " TODO: Add a test for the 'v' flag in 'cpo' (backspace doesn't remove 554 " TODO: Add a test for the 'v' flag in 'cpo'.
547 " characters from the screen) 555 " Backspaced characters remain visible on the screen in Insert mode.
548 556
549 " Test for the 'w' flag in 'cpo' ('cw' on a blank character changes only one 557 " Test for the 'w' flag in 'cpo' ('cw' on a blank character changes only one
550 " character) 558 " character)
551 func Test_cpo_w() 559 func Test_cpo_w()
552 let save_cpo = &cpo 560 let save_cpo = &cpo