Patch 9.0.0626

5 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 29, 2022, 4:38:25 PM9/29/22
to vim...@googlegroups.com

Patch 9.0.0626
Problem: Too many delete() calls in tests.
Solution: Use deferred delete where possible.
Files: src/testdir/test_mapping.vim, src/testdir/test_match.vim,
src/testdir/test_matchadd_conceal.vim,
src/testdir/test_memory_usage.vim, src/testdir/test_messages.vim,
src/testdir/test_mksession.vim, src/testdir/test_modeline.vim,
src/testdir/test_netbeans.vim, src/testdir/test_normal.vim,
src/testdir/test_number.vim


*** ../vim-9.0.0625/src/testdir/test_mapping.vim 2022-09-05 16:53:17.115566769 +0100
--- src/testdir/test_mapping.vim 2022-09-29 21:18:25.848797073 +0100
***************
*** 420,426 ****
nmap <expr> ! Func()
set updatetime=50
[CODE]
! call writefile(lines, 'Xtest.vim')

let buf = term_start(GetVimCommandCleanTerm() .. ' -S Xtest.vim', {'term_rows': 8})
let job = term_getjob(buf)
--- 420,426 ----
nmap <expr> ! Func()
set updatetime=50
[CODE]
! call writefile(lines, 'Xtest.vim', 'D')

let buf = term_start(GetVimCommandCleanTerm() .. ' -S Xtest.vim', {'term_rows': 8})
let job = term_getjob(buf)
***************
*** 439,445 ****
call assert_equal('', job_info(job).termsig)
endif

- call delete('Xtest.vim')
exe buf .. 'bwipe!'
endfunc

--- 439,444 ----
***************
*** 565,578 ****
endfunc
set stl=%{Status()}
END
! call writefile(lines, 'XtestExprMap')
let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10})
call term_sendkeys(buf, "\<C-B>")
call VerifyScreenDump(buf, 'Test_map_expr_1', {})

" clean up
call StopVimInTerminal(buf)
- call delete('XtestExprMap')
endfunc

func Test_map_listing()
--- 564,576 ----
endfunc
set stl=%{Status()}
END
! call writefile(lines, 'XtestExprMap', 'D')
let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10})
call term_sendkeys(buf, "\<C-B>")
call VerifyScreenDump(buf, 'Test_map_expr_1', {})

" clean up
call StopVimInTerminal(buf)
endfunc

func Test_map_listing()
***************
*** 581,594 ****
let lines =<< trim END
nmap a b
END
! call writefile(lines, 'XtestMapList')
let buf = RunVimInTerminal('-S XtestMapList', #{rows: 6})
call term_sendkeys(buf, ": nmap a\<CR>")
call VerifyScreenDump(buf, 'Test_map_list_1', {})

" clean up
call StopVimInTerminal(buf)
- call delete('XtestMapList')
endfunc

func Test_expr_map_error()
--- 579,591 ----
let lines =<< trim END
nmap a b
END
! call writefile(lines, 'XtestMapList', 'D')
let buf = RunVimInTerminal('-S XtestMapList', #{rows: 6})
call term_sendkeys(buf, ": nmap a\<CR>")
call VerifyScreenDump(buf, 'Test_map_list_1', {})

" clean up
call StopVimInTerminal(buf)
endfunc

func Test_expr_map_error()
***************
*** 605,611 ****

call test_override('ui_delay', 10)
END
! call writefile(lines, 'XtestExprMap')
let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10})
call term_sendkeys(buf, "\<F2>")
call TermWait(buf)
--- 602,608 ----

call test_override('ui_delay', 10)
END
! call writefile(lines, 'XtestExprMap', 'D')
let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10})
call term_sendkeys(buf, "\<F2>")
call TermWait(buf)
***************
*** 619,625 ****

" clean up
call StopVimInTerminal(buf)
- call delete('XtestExprMap')
endfunc

" Test for mapping errors
--- 616,621 ----
***************
*** 1081,1091 ****
let g:x = 32
endfunc
END
! call writefile(lines, 'Xscript')
source Xscript
call feedkeys("\<F2>", 'xt')
call assert_equal(32, g:x)
- call delete('Xscript')

unmap <F3>
unmap! <F3>
--- 1077,1086 ----
let g:x = 32
endfunc
END
! call writefile(lines, 'Xscript', 'D')
source Xscript
call feedkeys("\<F2>", 'xt')
call assert_equal(32, g:x)

unmap <F3>
unmap! <F3>
***************
*** 1530,1536 ****
endfunc

func Test_map_script_cmd_redo()
! call mkdir('Xmapcmd')
let lines =<< trim END
vim9script
import autoload './script.vim'
--- 1525,1531 ----
endfunc

func Test_map_script_cmd_redo()
! call mkdir('Xmapcmd', 'R')
let lines =<< trim END
vim9script
import autoload './script.vim'
***************
*** 1554,1560 ****

ounmap <F3>
nunmap j
- call delete('Xmapcmd', 'rf')
bwipe!
endfunc

--- 1549,1554 ----
***************
*** 1724,1730 ****
inoremap ab TEST
inoremap a <Nop>
END
! call writefile(lines, 'Xtest_map_after_timed_out_nop')
let buf = RunVimInTerminal('-S Xtest_map_after_timed_out_nop', #{rows: 6})

" Enter Insert mode
--- 1718,1724 ----
inoremap ab TEST
inoremap a <Nop>
END
! call writefile(lines, 'Xtest_map_after_timed_out_nop', 'D')
let buf = RunVimInTerminal('-S Xtest_map_after_timed_out_nop', #{rows: 6})

" Enter Insert mode
***************
*** 1741,1747 ****

" clean up
call StopVimInTerminal(buf)
- call delete('Xtest_map_after_timed_out_nop')
endfunc

func Test_using_past_typeahead()
--- 1735,1740 ----
*** ../vim-9.0.0625/src/testdir/test_match.vim 2022-09-29 13:50:04.715222469 +0100
--- src/testdir/test_match.vim 2022-09-29 21:19:24.572683282 +0100
***************
*** 372,383 ****
call printf('%s]%s', repeat('x', 50), repeat('x', 70))->setline(1)
call matchaddpos('ErrorMsg', [[1, 51]])
END
! call writefile(lines, 'XscriptMatchLinebreak')
let buf = RunVimInTerminal('-S XscriptMatchLinebreak', #{rows: 10})
call VerifyScreenDump(buf, 'Test_match_linebreak', {})

call StopVimInTerminal(buf)
- call delete('XscriptMatchLinebreak')
endfunc

func Test_match_with_incsearch()
--- 372,382 ----
call printf('%s]%s', repeat('x', 50), repeat('x', 70))->setline(1)
call matchaddpos('ErrorMsg', [[1, 51]])
END
! call writefile(lines, 'XscriptMatchLinebreak', 'D')
let buf = RunVimInTerminal('-S XscriptMatchLinebreak', #{rows: 10})
call VerifyScreenDump(buf, 'Test_match_linebreak', {})

call StopVimInTerminal(buf)
endfunc

func Test_match_with_incsearch()
***************
*** 388,394 ****
call setline(1, range(20))
call matchaddpos('ErrorMsg', [3])
END
! call writefile(lines, 'XmatchWithIncsearch')
let buf = RunVimInTerminal('-S XmatchWithIncsearch', #{rows: 6})
call VerifyScreenDump(buf, 'Test_match_with_incsearch_1', {})

--- 387,393 ----
call setline(1, range(20))
call matchaddpos('ErrorMsg', [3])
END
! call writefile(lines, 'XmatchWithIncsearch', 'D')
let buf = RunVimInTerminal('-S XmatchWithIncsearch', #{rows: 6})
call VerifyScreenDump(buf, 'Test_match_with_incsearch_1', {})

***************
*** 397,403 ****

call term_sendkeys(buf, "\<CR>")
call StopVimInTerminal(buf)
- call delete('XmatchWithIncsearch')
endfunc

" Test for deleting matches outside of the screen redraw top/bottom lines
--- 396,401 ----
***************
*** 428,439 ****
call setline(1, "\tix")
call matchadd('ErrorMsg', '\t')
END
! call writefile(lines, 'XscriptMatchTabLinebreak')
let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10})
call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {})

call StopVimInTerminal(buf)
- call delete('XscriptMatchTabLinebreak')
endfunc


--- 426,436 ----
call setline(1, "\tix")
call matchadd('ErrorMsg', '\t')
END
! call writefile(lines, 'XscriptMatchTabLinebreak', 'D')
let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10})
call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {})

call StopVimInTerminal(buf)
endfunc


*** ../vim-9.0.0625/src/testdir/test_matchadd_conceal.vim 2022-05-09 10:59:53.000000000 +0100
--- src/testdir/test_matchadd_conceal.vim 2022-09-29 21:20:01.524611838 +0100
***************
*** 374,380 ****
normal gg
"==expr==
END
! call writefile(lines, 'Xcolesearch')
let buf = RunVimInTerminal('Xcolesearch', {})
call TermWait(buf, 50)

--- 374,380 ----
normal gg
"==expr==
END
! call writefile(lines, 'Xcolesearch', 'D')
let buf = RunVimInTerminal('Xcolesearch', {})
call TermWait(buf, 50)

***************
*** 394,400 ****
call assert_equal(2, term_getcursor(buf)[1])

call StopVimInTerminal(buf)
- call delete('Xcolesearch')
endfunc

func Test_cursor_column_in_concealed_line_after_leftcol_change()
--- 394,399 ----
***************
*** 406,412 ****
call matchadd('Conceal', '-')
set nowrap ss=0 cole=3 cocu=n
END
! call writefile(lines, 'Xcurs-columns')
let buf = RunVimInTerminal('-S Xcurs-columns', {})

" Go to the end of the line (3 columns beyond the end of the screen).
--- 405,411 ----
call matchadd('Conceal', '-')
set nowrap ss=0 cole=3 cocu=n
END
! call writefile(lines, 'Xcurs-columns', 'D')
let buf = RunVimInTerminal('-S Xcurs-columns', {})

" Go to the end of the line (3 columns beyond the end of the screen).
***************
*** 422,428 ****
call assert_equal(1, term_getcursor(buf)[1])

call StopVimInTerminal(buf)
- call delete('Xcurs-columns')
endfunc

" vim: shiftwidth=2 sts=2 expandtab
--- 421,426 ----
*** ../vim-9.0.0625/src/testdir/test_memory_usage.vim 2022-06-15 18:05:59.000000000 +0100
--- src/testdir/test_memory_usage.vim 2022-09-29 21:20:43.608530547 +0100
***************
*** 92,98 ****
call s:f(0)
endfor
END
! call writefile(lines, testfile)

let vim = s:vim_new()
call vim.start('--clean', '-c', 'set noswapfile', testfile)
--- 92,98 ----
call s:f(0)
endfor
END
! call writefile(lines, testfile, 'D')

let vim = s:vim_new()
call vim.start('--clean', '-c', 'set noswapfile', testfile)
***************
*** 114,120 ****
call assert_inrange(lower, upper, after.max)

call vim.stop()
- call delete(testfile)
endfunc

func Test_memory_func_capture_lvars()
--- 114,119 ----
***************
*** 130,136 ****
call s:f()
endfor
END
! call writefile(lines, testfile)

let vim = s:vim_new()
call vim.start('--clean', '-c', 'set noswapfile', testfile)
--- 129,135 ----
call s:f()
endfor
END
! call writefile(lines, testfile, 'D')

let vim = s:vim_new()
call vim.start('--clean', '-c', 'set noswapfile', testfile)
***************
*** 161,167 ****
call assert_inrange(lower, upper, last)

call vim.stop()
- call delete(testfile)
endfunc

" vim: shiftwidth=2 sts=2 expandtab
--- 160,165 ----
*** ../vim-9.0.0625/src/testdir/test_messages.vim 2022-09-27 15:55:39.944808497 +0100
--- src/testdir/test_messages.vim 2022-09-29 21:22:09.908364217 +0100
***************
*** 103,109 ****
set statusline=%!StatusLine()
set laststatus=2
END
! call writefile(lines, testfile)

let rows = 10
let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
--- 103,109 ----
set statusline=%!StatusLine()
set laststatus=2
END
! call writefile(lines, testfile, 'D')

let rows = 10
let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
***************
*** 117,124 ****

call term_sendkeys(buf, ":qall!\<CR>")
call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
exe buf . 'bwipe!'
- call delete(testfile)
endfunc

func Test_mode_message_at_leaving_insert_with_esc_mapped()
--- 117,124 ----

call term_sendkeys(buf, ":qall!\<CR>")
call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
+
exe buf . 'bwipe!'
endfunc

func Test_mode_message_at_leaving_insert_with_esc_mapped()
***************
*** 131,137 ****
set laststatus=2
inoremap <Esc> <Esc>00
END
! call writefile(lines, testfile)

let rows = 10
let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
--- 131,137 ----
set laststatus=2
inoremap <Esc> <Esc>00
END
! call writefile(lines, testfile, 'D')

let rows = 10
let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
***************
*** 145,152 ****

call term_sendkeys(buf, ":qall!\<CR>")
call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
exe buf . 'bwipe!'
- call delete(testfile)
endfunc

func Test_echospace()
--- 145,152 ----

call term_sendkeys(buf, ":qall!\<CR>")
call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
+
exe buf . 'bwipe!'
endfunc

func Test_echospace()
***************
*** 462,468 ****
autocmd CursorHold * buf b.txt | w | echo "'b' written"
END

! call writefile(content, 'Xtest_fileinfo_after_echo')
let buf = RunVimInTerminal('-S Xtest_fileinfo_after_echo', #{rows: 6})
call term_sendkeys(buf, ":set updatetime=50\<CR>")
call term_sendkeys(buf, "0$")
--- 462,468 ----
autocmd CursorHold * buf b.txt | w | echo "'b' written"
END

! call writefile(content, 'Xtest_fileinfo_after_echo', 'D')
let buf = RunVimInTerminal('-S Xtest_fileinfo_after_echo', #{rows: 6})
call term_sendkeys(buf, ":set updatetime=50\<CR>")
call term_sendkeys(buf, "0$")
***************
*** 472,478 ****

" clean up
call StopVimInTerminal(buf)
- call delete('Xtest_fileinfo_after_echo')
call delete('b.txt')
endfunc

--- 472,477 ----
***************
*** 513,519 ****
echo 'three'
enddef
END
! call writefile(lines, 'XtestEchowindow')
let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
call VerifyScreenDump(buf, 'Test_echowindow_1', {})

--- 512,518 ----
echo 'three'
enddef
END
! call writefile(lines, 'XtestEchowindow', 'D')
let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
call VerifyScreenDump(buf, 'Test_echowindow_1', {})

***************
*** 542,548 ****

" clean up
call StopVimInTerminal(buf)
- call delete('XtestEchowindow')
endfunc

" messages window should not be used while evaluating the :echowin argument
--- 541,546 ----
***************
*** 556,568 ****
endfunc
echowindow ShowMessage()
END
! call writefile(lines, 'XtestEchowindow')
let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
call VerifyScreenDump(buf, 'Test_echowin_eval', {})

" clean up
call StopVimInTerminal(buf)
- call delete('XtestEchowindow')
endfunc

" messages window should not be used for showing the mode
--- 554,565 ----
endfunc
echowindow ShowMessage()
END
! call writefile(lines, 'XtestEchowindow', 'D')
let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
call VerifyScreenDump(buf, 'Test_echowin_eval', {})

" clean up
call StopVimInTerminal(buf)
endfunc

" messages window should not be used for showing the mode
*** ../vim-9.0.0625/src/testdir/test_mksession.vim 2022-09-02 21:55:45.503049444 +0100
--- src/testdir/test_mksession.vim 2022-09-29 21:22:43.976298649 +0100
***************
*** 1098,1111 ****
bwipe!

" Recreate the swap file to pretend the file is being edited
! call writefile(cont, fname)
set shortmess+=A
source Xtestsession

set shortmess&
set sessionoptions&
call delete('Xtestsession')
- call delete(fname)
endfunc

" Test for mksession with 'compatible' option
--- 1098,1110 ----
bwipe!

" Recreate the swap file to pretend the file is being edited
! call writefile(cont, fname, 'D')
set shortmess+=A
source Xtestsession

set shortmess&
set sessionoptions&
call delete('Xtestsession')
endfunc

" Test for mksession with 'compatible' option
***************
*** 1235,1241 ****

" Test for creating views with manual folds
func Test_mkview_manual_fold()
! call writefile(range(1,10), 'Xmkvfile')
new Xmkvfile
" create recursive folds
5,6fold
--- 1234,1240 ----

" Test for creating views with manual folds
func Test_mkview_manual_fold()
! call writefile(range(1,10), 'Xmkvfile', 'D')
new Xmkvfile
" create recursive folds
5,6fold
***************
*** 1259,1265 ****
source Xview
call assert_equal([-1, -1, -1, -1, -1, -1], [foldclosed(3), foldclosed(4),
\ foldclosed(5), foldclosed(6), foldclosed(7), foldclosed(8)])
- call delete('Xmkvfile')
call delete('Xview')
bw!
endfunc
--- 1258,1263 ----
*** ../vim-9.0.0625/src/testdir/test_modeline.vim 2022-09-02 21:55:45.503049444 +0100
--- src/testdir/test_modeline.vim 2022-09-29 21:25:16.668005370 +0100
***************
*** 4,10 ****

func Test_modeline_invalid()
" This was reading allocated memory in the past.
! call writefile(['vi:0', 'nothing'], 'Xmodeline')
let modeline = &modeline
set modeline
call assert_fails('split Xmodeline', 'E518:')
--- 4,10 ----

func Test_modeline_invalid()
" This was reading allocated memory in the past.
! call writefile(['vi:0', 'nothing'], 'Xmodeline', 'D')
let modeline = &modeline
set modeline
call assert_fails('split Xmodeline', 'E518:')
***************
*** 29,39 ****

let &modeline = modeline
bwipe!
- call delete('Xmodeline')
endfunc

func Test_modeline_filetype()
! call writefile(['vim: set ft=c :', 'nothing'], 'Xmodeline_filetype')
let modeline = &modeline
set modeline
filetype plugin on
--- 29,38 ----

let &modeline = modeline
bwipe!
endfunc

func Test_modeline_filetype()
! call writefile(['vim: set ft=c :', 'nothing'], 'Xmodeline_filetype', 'D')
let modeline = &modeline
set modeline
filetype plugin on
***************
*** 43,55 ****
call assert_equal("ccomplete#Complete", &ofu)

bwipe!
- call delete('Xmodeline_filetype')
let &modeline = modeline
filetype plugin off
endfunc

func Test_modeline_syntax()
! call writefile(['vim: set syn=c :', 'nothing'], 'Xmodeline_syntax')
let modeline = &modeline
set modeline
syntax enable
--- 42,53 ----
call assert_equal("ccomplete#Complete", &ofu)

bwipe!
let &modeline = modeline
filetype plugin off
endfunc

func Test_modeline_syntax()
! call writefile(['vim: set syn=c :', 'nothing'], 'Xmodeline_syntax', 'D')
let modeline = &modeline
set modeline
syntax enable
***************
*** 58,71 ****
call assert_equal("c", b:current_syntax)

bwipe!
- call delete('Xmodeline_syntax')
let &modeline = modeline
syntax off
endfunc

func Test_modeline_keymap()
CheckFeature keymap
! call writefile(['vim: set keymap=greek :', 'nothing'], 'Xmodeline_keymap')
let modeline = &modeline
set modeline
split Xmodeline_keymap
--- 56,68 ----
call assert_equal("c", b:current_syntax)

bwipe!
let &modeline = modeline
syntax off
endfunc

func Test_modeline_keymap()
CheckFeature keymap
! call writefile(['vim: set keymap=greek :', 'nothing'], 'Xmodeline_keymap', 'D')
let modeline = &modeline
set modeline
split Xmodeline_keymap
***************
*** 73,79 ****
call assert_match('greek\|grk', b:keymap_name)

bwipe!
- call delete('Xmodeline_keymap')
let &modeline = modeline
set keymap= iminsert=0 imsearch=-1
endfunc
--- 70,75 ----
***************
*** 83,89 ****
set modeline

" Test with vim:{vers}: (version {vers} or later).
! call writefile(['// vim' .. v:version .. ': ts=2:'], 'Xmodeline_version')
edit Xmodeline_version
call assert_equal(2, &ts)
bwipe!
--- 79,85 ----
set modeline

" Test with vim:{vers}: (version {vers} or later).
! call writefile(['// vim' .. v:version .. ': ts=2:'], 'Xmodeline_version', 'D')
edit Xmodeline_version
call assert_equal(2, &ts)
bwipe!
***************
*** 147,160 ****
bwipe!

let &modeline = modeline
- call delete('Xmodeline_version')
endfunc

func Test_modeline_colon()
let modeline = &modeline
set modeline

! call writefile(['// vim: set showbreak=\: ts=2: sw=2'], 'Xmodeline_colon')
edit Xmodeline_colon

" backlash colon should become colon.
--- 143,155 ----
bwipe!

let &modeline = modeline
endfunc

func Test_modeline_colon()
let modeline = &modeline
set modeline

! call writefile(['// vim: set showbreak=\: ts=2: sw=2'], 'Xmodeline_colon', 'D')
edit Xmodeline_colon

" backlash colon should become colon.
***************
*** 166,178 ****
call assert_equal(8, &sw)

let &modeline = modeline
- call delete('Xmodeline_colon')
endfunc

func s:modeline_fails(what, text, error)
call CheckOption(a:what)
let fname = "Xmodeline_fails_" . a:what
! call writefile(['vim: set ' . a:text . ' :', 'nothing'], fname)
let modeline = &modeline
set modeline
filetype plugin on
--- 161,172 ----
call assert_equal(8, &sw)

let &modeline = modeline
endfunc

func s:modeline_fails(what, text, error)
call CheckOption(a:what)
let fname = "Xmodeline_fails_" . a:what
! call writefile(['vim: set ' . a:text . ' :', 'nothing'], fname, 'D')
let modeline = &modeline
set modeline
filetype plugin on
***************
*** 182,188 ****
call assert_equal("", &syntax)

bwipe!
- call delete(fname)
let &modeline = modeline
filetype plugin off
syntax off
--- 176,181 ----
***************
*** 292,298 ****
7 seven
8 eight
END
! call writefile(lines, 'Xmodeline')
edit Xmodeline
let info = split(execute('verbose set tabstop?'), "\n")
call assert_match('^\s*Last set from modeline line 1$', info[-1])
--- 285,291 ----
7 seven
8 eight
END
! call writefile(lines, 'Xmodeline', 'D')
edit Xmodeline
let info = split(execute('verbose set tabstop?'), "\n")
call assert_match('^\s*Last set from modeline line 1$', info[-1])
***************
*** 331,337 ****
bwipe!

let &modeline = modeline
- call delete('Xmodeline')
endfunc

" Test for the 'modeline' default value in compatible and non-compatible modes
--- 324,329 ----
***************
*** 350,371 ****

" Some options cannot be set from the modeline when 'diff' option is set
func Test_modeline_diff_buffer()
! call writefile(['vim: diff foldmethod=marker wrap'], 'Xmdifile')
set foldmethod& nowrap
new Xmdifile
call assert_equal('manual', &foldmethod)
call assert_false(&wrap)
set wrap&
- call delete('Xmdifile')
bw
endfunc

func Test_modeline_disable()
set modeline
! call writefile(['vim: sw=2', 'vim: nomodeline', 'vim: sw=3'], 'Xmodeline_disable')
edit Xmodeline_disable
call assert_equal(2, &sw)
- call delete('Xmodeline_disable')
endfunc

" vim: shiftwidth=2 sts=2 expandtab
--- 342,361 ----

" Some options cannot be set from the modeline when 'diff' option is set
func Test_modeline_diff_buffer()
! call writefile(['vim: diff foldmethod=marker wrap'], 'Xmdifile', 'D')
set foldmethod& nowrap
new Xmdifile
call assert_equal('manual', &foldmethod)
call assert_false(&wrap)
set wrap&
bw
endfunc

func Test_modeline_disable()
set modeline
! call writefile(['vim: sw=2', 'vim: nomodeline', 'vim: sw=3'], 'Xmodeline_disable', 'D')
edit Xmodeline_disable
call assert_equal(2, &sw)
endfunc

" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-9.0.0625/src/testdir/test_netbeans.vim 2021-05-31 18:19:18.000000000 +0100
--- src/testdir/test_netbeans.vim 2022-09-29 21:28:22.783648950 +0100
***************
*** 41,48 ****
endfunc

func Nb_basic(port)
! call delete("Xnetbeans")
! call writefile([], "Xnetbeans")

" Last line number in the Xnetbeans file. Used to verify the result of the
" communication with the netbeans server
--- 41,47 ----
endfunc

func Nb_basic(port)
! call writefile([], "Xnetbeans", 'D')

" Last line number in the Xnetbeans file. Used to verify the result of the
" communication with the netbeans server
***************
*** 79,85 ****
sleep 1m

" getCursor test
! call writefile(['foo bar', 'foo bar', 'foo bar'], 'Xfile1')
split Xfile1
call cursor(3, 4)
sleep 10m
--- 78,84 ----
sleep 1m

" getCursor test
! call writefile(['foo bar', 'foo bar', 'foo bar'], 'Xfile1', 'D')
split Xfile1
call cursor(3, 4)
sleep 10m
***************
*** 272,278 ****
let g:last += 4

" editFile test
! call writefile(['foo bar1', 'foo bar2', 'foo bar3'], 'Xfile3')
call appendbufline(cmdbufnr, '$', 'editFile_Test')
call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
let l = ReadXnetbeans()
--- 271,277 ----
let g:last += 4

" editFile test
! call writefile(['foo bar1', 'foo bar2', 'foo bar3'], 'Xfile3', 'D')
call appendbufline(cmdbufnr, '$', 'editFile_Test')
call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
let l = ReadXnetbeans()
***************
*** 838,846 ****
call sign_unplace('*')
call sign_undefine()

- call delete("Xnetbeans")
- call delete('Xfile1')
- call delete('Xfile3')
call delete('Xfile4')
endfunc

--- 837,842 ----
***************
*** 851,860 ****

func Nb_file_auth(port)
call delete("Xnetbeans")
! call writefile([], "Xnetbeans")

call assert_fails('nbstart =notexist', 'E660:')
! call writefile(['host=localhost', 'port=' . a:port, 'auth=bunny'], 'Xnbauth')
if has('unix')
call setfperm('Xnbauth', "rw-r--r--")
call assert_fails('nbstart =Xnbauth', 'E668:')
--- 847,856 ----

func Nb_file_auth(port)
call delete("Xnetbeans")
! call writefile([], "Xnetbeans", 'D')

call assert_fails('nbstart =notexist', 'E660:')
! call writefile(['host=localhost', 'port=' . a:port, 'auth=bunny'], 'Xnbauth', 'D')
if has('unix')
call setfperm('Xnbauth', "rw-r--r--")
call assert_fails('nbstart =Xnbauth', 'E668:')
***************
*** 871,877 ****
call assert_equal('0:startupDone=0', lines[2])

call delete("Xnbauth")
- call delete("Xnetbeans")
endfunc

func Test_nb_file_auth()
--- 867,872 ----
***************
*** 882,888 ****
" Test for quitting Vim with an open netbeans connection
func Nb_quit_with_conn(port)
call delete("Xnetbeans")
! call writefile([], "Xnetbeans")
let after =<< trim END
source shared.vim
set cpo&vim
--- 877,883 ----
" Test for quitting Vim with an open netbeans connection
func Nb_quit_with_conn(port)
call delete("Xnetbeans")
! call writefile([], "Xnetbeans", 'D')
let after =<< trim END
source shared.vim
set cpo&vim
***************
*** 922,928 ****
call assert_equal('1:killed=16', l[-2])
call assert_equal('0:disconnect=16', l[-1])
endif
- call delete('Xnetbeans')
endfunc

func Test_nb_quit_with_conn()
--- 917,922 ----
*** ../vim-9.0.0625/src/testdir/test_normal.vim 2022-09-02 21:55:45.503049444 +0100
--- src/testdir/test_normal.vim 2022-09-29 21:31:42.602860281 +0100
***************
*** 299,305 ****
CheckNotMSWindows

" uses sed to number non-empty lines
! call writefile(['#!/bin/sh', 'sed ''/./=''|sed ''/./{', 'N', 's/\n/ /', '}'''], 'Xsed_format.sh')
call system('chmod +x ./Xsed_format.sh')
let text = ['a', '', 'c', '', ' ', 'd', 'e']
let expected = ['1 a', '', '3 c', '', '5 ', '6 d', '7 e']
--- 299,305 ----
CheckNotMSWindows

" uses sed to number non-empty lines
! call writefile(['#!/bin/sh', 'sed ''/./=''|sed ''/./{', 'N', 's/\n/ /', '}'''], 'Xsed_format.sh', 'D')
call system('chmod +x ./Xsed_format.sh')
let text = ['a', '', 'c', '', ' ', 'd', 'e']
let expected = ['1 a', '', '3 c', '', '5 ', '6 d', '7 e']
***************
*** 330,336 ****
" clean up
set formatprg=
setlocal formatprg=
- call delete('Xsed_format.sh')
endfunc

func Test_normal07_internalfmt()
--- 330,335 ----
***************
*** 702,712 ****
call writefile([execute('messages')], 'Xtest.out')
qall
END
! call writefile(cleanup, 'Xverify.vim')
call RunVim([], [], "-c \"set opfunc=s:abc\" -S Xverify.vim")
call assert_match('E81: Using <SID> not in a', readfile('Xtest.out')[0])
call delete('Xtest.out')
- call delete('Xverify.vim')

" cleanup
set opfunc&
--- 701,710 ----
call writefile([execute('messages')], 'Xtest.out')
qall
END
! call writefile(cleanup, 'Xverify.vim', 'D')
call RunVim([], [], "-c \"set opfunc=s:abc\" -S Xverify.vim")
call assert_match('E81: Using <SID> not in a', readfile('Xtest.out')[0])
call delete('Xtest.out')

" cleanup
set opfunc&
***************
*** 1292,1302 ****
call writefile(['done'], 'Xdone')
qa!
END
! call writefile(lines, 'Xscript')
call assert_equal(1, RunVim([], [], '--clean -X -Z -e -s -S Xscript'))
call assert_equal(['done'], readfile('Xdone'))

- call delete('Xscript')
call delete('Xdone')
endfunc

--- 1290,1299 ----
call writefile(['done'], 'Xdone')
qa!
END
! call writefile(lines, 'Xscript', 'D')
call assert_equal(1, RunVim([], [], '--clean -X -Z -e -s -S Xscript'))
call assert_equal(['done'], readfile('Xdone'))

call delete('Xdone')
endfunc

***************
*** 1709,1724 ****
func Test_normal20_exmode()
" Reading from redirected file doesn't work on MS-Windows
CheckNotMSWindows
! call writefile(['1a', 'foo', 'bar', '.', 'w! Xn20file2', 'q!'], 'Xn20script')
! call writefile(['1', '2'], 'Xn20file')
call system(GetVimCommand() .. ' -e -s < Xn20script Xn20file')
! let a=readfile('Xn20file2')
call assert_equal(['1', 'foo', 'bar', '2'], a)

" clean up
! for file in ['Xn20file', 'Xn20file2', 'Xn20script']
! call delete(file)
! endfor
bw!
endfunc

--- 1706,1719 ----
func Test_normal20_exmode()
" Reading from redirected file doesn't work on MS-Windows
CheckNotMSWindows
! call writefile(['1a', 'foo', 'bar', '.', 'w! Xn20file2', 'q!'], 'Xn20script', 'D')
! call writefile(['1', '2'], 'Xn20file', 'D')
call system(GetVimCommand() .. ' -e -s < Xn20script Xn20file')
! let a = readfile('Xn20file2')
call assert_equal(['1', 'foo', 'bar', '2'], a)

" clean up
! call delete('Xn20file2')
bw!
endfunc

***************
*** 1758,1764 ****
" Test for ZZ
" let shell = &shell
" let &shell = 'sh'
! call writefile(['1', '2'], 'Xn22file')
let args = ' -N -i NONE --noplugins -X --not-a-term'
call system(GetVimCommand() .. args .. ' -c "%d" -c ":norm! ZZ" Xn22file')
let a = readfile('Xn22file')
--- 1753,1759 ----
" Test for ZZ
" let shell = &shell
" let &shell = 'sh'
! call writefile(['1', '2'], 'Xn22file', 'D')
let args = ' -N -i NONE --noplugins -X --not-a-term'
call system(GetVimCommand() .. args .. ' -c "%d" -c ":norm! ZZ" Xn22file')
let a = readfile('Xn22file')
***************
*** 1773,1781 ****
call assert_beeps('normal! ZW')

" clean up
- for file in ['Xn22file']
- call delete(file)
- endfor
" let &shell = shell
endfunc

--- 1768,1773 ----
***************
*** 3141,3147 ****
CheckFeature autocmd
" Don't sleep after the warning message.
call test_settime(1)
! call writefile(['foo'], 'Xreadonly.log')
new Xreadonly.log
setl ro
au FileChangedRO <buffer> :call feedkeys("\<c-^>", 'tix')
--- 3133,3139 ----
CheckFeature autocmd
" Don't sleep after the warning message.
call test_settime(1)
! call writefile(['foo'], 'Xreadonly.log', 'D')
new Xreadonly.log
setl ro
au FileChangedRO <buffer> :call feedkeys("\<c-^>", 'tix')
***************
*** 3152,3158 ****
" cleanup
call test_settime(0)
bw!
- call delete("Xreadonly.log")
endfunc

func Test_normal52_rl()
--- 3144,3149 ----
*** ../vim-9.0.0625/src/testdir/test_number.vim 2022-03-27 19:06:37.000000000 +0100
--- src/testdir/test_number.vim 2022-09-29 21:32:14.514730372 +0100
***************
*** 276,282 ****
set number relativenumber
hi LineNr ctermfg=red
[CODE]
! call writefile(lines, 'XTest_relnr')

" Check that the balloon shows up after a mouse move
let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50})
--- 276,282 ----
set number relativenumber
hi LineNr ctermfg=red
[CODE]
! call writefile(lines, 'XTest_relnr', 'D')

" Check that the balloon shows up after a mouse move
let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50})
***************
*** 295,301 ****

" clean up
call StopVimInTerminal(buf)
- call delete('XTest_relnr')
endfunc

func Test_relativenumber_callback()
--- 295,300 ----
***************
*** 313,326 ****

call timer_start(300, 'Func')
END
! call writefile(lines, 'Xrnu_timer')

let buf = RunVimInTerminal('-S Xrnu_timer', #{rows: 8})
call TermWait(buf, 310)
call VerifyScreenDump(buf, 'Test_relativenumber_callback_1', {})

call StopVimInTerminal(buf)
- call delete('Xrnu_timer')
endfunc

" Test for displaying line numbers with 'rightleft'
--- 312,324 ----

call timer_start(300, 'Func')
END
! call writefile(lines, 'Xrnu_timer', 'D')

let buf = RunVimInTerminal('-S Xrnu_timer', #{rows: 8})
call TermWait(buf, 310)
call VerifyScreenDump(buf, 'Test_relativenumber_callback_1', {})

call StopVimInTerminal(buf)
endfunc

" Test for displaying line numbers with 'rightleft'
*** ../vim-9.0.0625/src/version.c 2022-09-29 21:01:52.206807939 +0100
--- src/version.c 2022-09-29 21:34:21.010248523 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 626,
/**/

--
hundred-and-one symptoms of being an internet addict:
223. You set up a web-cam as your home's security system.

/// 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