Patch 8.2.2592
Problem: Code coverage could be improved.
Solution: Add a few more tests. (Dominique Pellé, closes #7957)
Files: src/testdir/test_fileformat.vim, src/testdir/test_normal.vim,
src/testdir/test_sleep.vim, src/testdir/test_textformat.vim,
src/testdir/test_viminfo.vim
*** ../vim-8.2.2591/src/testdir/test_fileformat.vim 2020-08-12 18:50:31.875655822 +0200
--- src/testdir/test_fileformat.vim 2021-03-13 13:12:42.098354678 +0100
***************
*** 33,38 ****
--- 33,47 ----
bw!
endfunc
+ func Test_fileformat_nomodifiable()
+ new
+ setlocal nomodifiable
+
+ call assert_fails('set fileformat=latin1', 'E21:')
+
+ bw
+ endfunc
+
" Convert the contents of a file into a literal string
func s:file2str(fname)
let b = readfile(a:fname, 'B')
*** ../vim-8.2.2591/src/testdir/test_normal.vim 2021-01-26 22:42:17.694836803 +0100
--- src/testdir/test_normal.vim 2021-03-13 13:12:42.098354678 +0100
***************
*** 3207,3212 ****
--- 3207,3219 ----
" delete to a readonly register
call setline(1, ['abcd'])
call assert_beeps('normal ":d2l')
+
+ " D and d with 'nomodifiable'
+ call setline(1, ['abcd'])
+ setlocal nomodifiable
+ call assert_fails('normal D', 'E21:')
+ call assert_fails('normal d$', 'E21:')
+
close!
endfunc
*** ../vim-8.2.2591/src/testdir/test_sleep.vim 2021-01-16 20:20:59.650487081 +0100
--- src/testdir/test_sleep.vim 2021-03-13 13:12:42.098354678 +0100
***************
*** 21,26 ****
--- 21,27 ----
call s:assert_takes_longer('sl 50m', 50)
call s:assert_takes_longer('sl! 50m', 50)
call s:assert_takes_longer('1sleep', 1000)
+ call s:assert_takes_longer('normal 1gs', 1000)
endfunc
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2591/src/testdir/test_textformat.vim 2020-12-20 13:07:44.817149460 +0100
--- src/testdir/test_textformat.vim 2021-03-13 13:12:42.098354678 +0100
***************
*** 858,863 ****
--- 858,878 ----
close!
endfunc
+ func Test_mps_error()
+ let encoding_save = &encoding
+
+ for e in ['utf-8', 'latin1']
+ exe 'set encoding=' .. e
+
+ call assert_fails('set mps=<:', 'E474:', e)
+ call assert_fails('set mps=:>', 'E474:', e)
+ call assert_fails('set mps=<>', 'E474:', e)
+ call assert_fails('set mps=<:>_', 'E474:', e)
+ endfor
+
+ let &encoding = encoding_save
+ endfunc
+
" Test for ra on multi-byte characters
func Test_ra_multibyte()
new
*** ../vim-8.2.2591/src/testdir/test_viminfo.vim 2021-02-11 18:36:27.584202581 +0100
--- src/testdir/test_viminfo.vim 2021-03-13 13:12:42.098354678 +0100
***************
*** 906,911 ****
--- 906,915 ----
call delete('Xviminfofile')
call delete('Xviminfotest')
call delete('Xnew-file.txt')
+
+ let v:oldfiles = test_null_list()
+ call assert_equal("\nNo old files", execute('oldfiles'))
+
let &viminfo = save_viminfo
let &viminfofile = save_viminfofile
endfunc
*** ../vim-8.2.2591/src/version.c 2021-03-12 22:16:36.203481459 +0100
--- src/version.c 2021-03-13 13:13:13.554271403 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2592,
/**/
--
It is too bad that the speed of light hasn't kept pace with the
changes in CPU speed and network bandwidth. -- <
wie...@porcupine.org>
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///