Patch 8.2.2837

6 views
Skip to first unread message

Bram Moolenaar

unread,
May 6, 2021, 11:37:35 AM5/6/21
to vim...@googlegroups.com

Patch 8.2.2837
Problem: Various code lines not covered by tests.
Solution: Add test cases. (Dominique Pellé, closes #8178)
Files: src/testdir/test_excmd.vim, src/testdir/test_functions.vim,
src/testdir/test_options.vim, src/testdir/test_startup.vim,
src/testdir/test_syntax.vim, src/testdir/test_vim9_cmd.vim


*** ../vim-8.2.2836/src/testdir/test_excmd.vim 2021-05-02 20:16:19.991169536 +0200
--- src/testdir/test_excmd.vim 2021-05-06 17:34:05.624332883 +0200
***************
*** 591,594 ****
--- 591,600 ----
sandbox call Sandbox_tests()
endfunc

+ func Test_command_not_implemented_E319()
+ if !has('mzscheme')
+ call assert_fails('mzscheme', 'E319:')
+ endif
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2836/src/testdir/test_functions.vim 2021-04-14 17:06:39.928955007 +0200
--- src/testdir/test_functions.vim 2021-05-06 17:34:05.624332883 +0200
***************
*** 1148,1154 ****
--- 1148,1156 ----
call assert_equal(2, charidx(a, 4))
call assert_equal(3, charidx(a, 7))
call assert_equal(-1, charidx(a, 8))
+ call assert_equal(-1, charidx(a, -1))
call assert_equal(-1, charidx('', 0))
+ call assert_equal(-1, charidx(test_null_string(), 0))

" count composing characters
call assert_equal(0, charidx(a, 0, 1))
*** ../vim-8.2.2836/src/testdir/test_options.vim 2021-03-13 14:28:59.339594607 +0100
--- src/testdir/test_options.vim 2021-05-06 17:34:05.624332883 +0200
***************
*** 1093,1096 ****
--- 1093,1124 ----
call delete('Xscroll')
endfunc

+ " Check that VIM_POSIX env variable influences default value of 'cpo' and 'shm'
+ func Test_VIM_POSIX()
+ let saved_VIM_POSIX = getenv("VIM_POSIX")
+
+ call setenv('VIM_POSIX', "1")
+ let after =<< trim [CODE]
+ call writefile([&cpo, &shm], 'X_VIM_POSIX')
+ qall
+ [CODE]
+ if RunVim([], after, '')
+ call assert_equal(['aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>#{|&/\.;',
+ \ 'AS'], readfile('X_VIM_POSIX'))
+ endif
+
+ call setenv('VIM_POSIX', v:null)
+ let after =<< trim [CODE]
+ call writefile([&cpo, &shm], 'X_VIM_POSIX')
+ qall
+ [CODE]
+ if RunVim([], after, '')
+ call assert_equal(['aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>;',
+ \ 'S'], readfile('X_VIM_POSIX'))
+ endif
+
+ call delete('X_VIM_POSIX')
+ call setenv('VIM_POSIX', saved_VIM_POSIX)
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2836/src/testdir/test_startup.vim 2021-03-27 12:11:29.914607383 +0100
--- src/testdir/test_startup.vim 2021-05-06 17:34:05.624332883 +0200
***************
*** 622,627 ****
--- 622,633 ----
endfor

if has('gui_gtk')
+ let out = split(system(GetVimCommand() .. ' --socketid'), "\n")
+ call assert_equal(1, v:shell_error)
+ call assert_match('^VIM - Vi IMproved .* (.*)$', out[0])
+ call assert_equal('Argument missing after: "--socketid"', out[1])
+ call assert_equal('More info with: "vim -h"', out[2])
+
for opt in ['--socketid x', '--socketid 0xg']
let out = split(system(GetVimCommand() .. ' ' .. opt), "\n")
call assert_equal(1, v:shell_error)
***************
*** 629,634 ****
--- 635,641 ----
call assert_equal('Invalid argument for: "--socketid"', out[1])
call assert_equal('More info with: "vim -h"', out[2])
endfor
+
endif
endfunc

*** ../vim-8.2.2836/src/testdir/test_syntax.vim 2021-04-14 11:15:05.336785013 +0200
--- src/testdir/test_syntax.vim 2021-05-06 17:34:05.624332883 +0200
***************
*** 111,116 ****
--- 111,119 ----
let a = execute('syntime report')
call assert_equal("\nNo Syntax items defined for this buffer", a)

+ let a = execute('syntime clear')
+ call assert_equal("\nNo Syntax items defined for this buffer", a)
+
view ../memfile_test.c
setfiletype cpp
redraw
*** ../vim-8.2.2836/src/testdir/test_vim9_cmd.vim 2021-04-26 20:32:54.918399234 +0200
--- src/testdir/test_vim9_cmd.vim 2021-05-06 17:34:05.624332883 +0200
***************
*** 13,18 ****
--- 13,19 ----
vim9cm assert_equal('yes', y)
END
CheckScriptSuccess(lines)
+ assert_fails('vim9cmd', 'E1164:')
enddef

def Test_edit_wildcards()
*** ../vim-8.2.2836/src/version.c 2021-05-05 22:51:35.631336525 +0200
--- src/version.c 2021-05-06 17:36:16.008075287 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2837,
/**/

--
hundred-and-one symptoms of being an internet addict:
237. You tattoo your email address on your forehead.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages