Patch 8.2.0270
Problem: Some code not covered by tests.
Solution: Add test cases. (Yegappan Lakshmanan, closes #5649)
Files: src/testdir/test_autocmd.vim, src/testdir/test_buffer.vim,
src/testdir/test_edit.vim, src/testdir/test_ex_mode.vim,
src/testdir/test_excmd.vim, src/testdir/test_expand.vim,
src/testdir/test_filetype.vim, src/testdir/test_findfile.vim,
src/testdir/test_join.vim, src/testdir/test_move.vim,
src/testdir/test_normal.vim, src/testdir/test_registers.vim,
src/testdir/test_source.vim, src/testdir/test_tabpage.vim,
src/testdir/test_tagjump.vim, src/testdir/test_vimscript.vim,
src/testdir/test_visual.vim, src/testdir/test_window_cmd.vim,
src/testdir/test_writefile.vim
*** ../vim-8.2.0269/src/testdir/test_autocmd.vim 2020-01-07
20:11:38.148168731 +0100
--- src/testdir/test_autocmd.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 2357,2359 ****
--- 2357,2361 ----
au! crash
setglobal spellfile=
endfunc
+
+ " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0269/src/testdir/test_buffer.vim 2020-02-16 13:33:52.047371845
+0100
--- src/testdir/test_buffer.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 103,111 ****
call assert_equal(b2, bufnr())
call assert_equal(1, line('.'))
! brewind +/foo3
call assert_equal(b1, bufnr())
! call assert_equal(3, line('.'))
blast +/baz2
call assert_equal(b3, bufnr())
--- 103,111 ----
call assert_equal(b2, bufnr())
call assert_equal(1, line('.'))
! brewind +
call assert_equal(b1, bufnr())
! call assert_equal(4, line('.'))
blast +/baz2
call assert_equal(b3, bufnr())
*** ../vim-8.2.0269/src/testdir/test_edit.vim 2020-01-26 21:59:25.632718110
+0100
--- src/testdir/test_edit.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 1500,1505 ****
--- 1500,1521 ----
bwipe!
endfunc
+ " Test for :startreplace and :startgreplace
+ func Test_edit_startreplace()
+ new
+ call setline(1, 'abc')
+ call feedkeys("l:startreplace\<CR>xyz\e", 'xt')
+ call assert_equal('axyz', getline(1))
+ call feedkeys("0:startreplace!\<CR>abc\e", 'xt')
+ call assert_equal('axyzabc', getline(1))
+ call setline(1, "a\tb")
+ call feedkeys("0l:startgreplace\<CR>xyz\e", 'xt')
+ call assert_equal("axyz\tb", getline(1))
+ call feedkeys("0i\<C-R>=execute('startreplace')\<CR>12\e", 'xt')
+ call assert_equal("12axyz\tb", getline(1))
+ close!
+ endfunc
+
func Test_edit_noesckeys()
CheckNotGui
new
***************
*** 1519,1521 ****
--- 1535,1539 ----
bwipe!
set esckeys
endfunc
+
+ " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0269/src/testdir/test_ex_mode.vim 2020-02-11
22:03:43.038846226 +0100
--- src/testdir/test_ex_mode.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 55,61 ****
let &encoding = encoding_save
endfunc
! " Test subsittute confirmation prompt :%s/pat/str/c in Ex mode
func Test_Ex_substitute()
CheckRunVimInTerminal
let buf = RunVimInTerminal('', {'rows': 6})
--- 55,61 ----
let &encoding = encoding_save
endfunc
! " Test substitute confirmation prompt :%s/pat/str/c in Ex mode
func Test_Ex_substitute()
CheckRunVimInTerminal
let buf = RunVimInTerminal('', {'rows': 6})
***************
*** 77,82 ****
--- 77,87 ----
call term_sendkeys(buf, "q\<CR>")
call WaitForAssert({-> assert_match(':', term_getline(buf, 6))}, 1000)
+ " Pressing enter in ex mode should print the current line
+ call term_sendkeys(buf, "\<CR>")
+ call WaitForAssert({-> assert_match(' 3 foo foo',
+ \ term_getline(buf, 5))}, 1000)
+
call term_sendkeys(buf, ":vi\<CR>")
call WaitForAssert({-> assert_match('foo bar', term_getline(buf, 1))}, 1000)
*** ../vim-8.2.0269/src/testdir/test_excmd.vim 2020-02-11 22:03:43.038846226
+0100
--- src/testdir/test_excmd.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 267,272 ****
--- 267,282 ----
call assert_fails('redir! > Xfile', 'E190:')
call delete('Xfile')
endif
+
+ " Test for redirecting to a register
+ redir @q> | echon 'clean ' | redir END
+ redir @q>> | echon 'water' | redir END
+ call assert_equal('clean water', @q)
+
+ " Test for redirecting to a variable
+ redir => color | echon 'blue ' | redir END
+ redir =>> color | echon 'sky' | redir END
+ call assert_equal('blue sky', color)
endfunc
" Test for the :filetype command
***************
*** 279,282 ****
--- 289,338 ----
call assert_fails('mode abc', 'E359:')
endfunc
+ " Test for the :sleep command
+ func Test_sleep_cmd()
+ call assert_fails('sleep x', 'E475:')
+ endfunc
+
+ " Test for the :read command
+ func Test_read_cmd()
+ call writefile(['one'], 'Xfile')
+ new
+ call assert_fails('read', 'E32:')
+ edit Xfile
+ read
+ call assert_equal(['one', 'one'], getline(1, '$'))
+ close!
+ new
+ read Xfile
+ call assert_equal(['', 'one'], getline(1, '$'))
+ call deletebufline('', 1, '$')
+ call feedkeys("Qr Xfile\<CR>visual\<CR>", 'xt')
+ call assert_equal(['one'], getline(1, '$'))
+ close!
+ call delete('Xfile')
+ endfunc
+
+ " Test for running Ex commands when text is locked.
+ " <C-\>e in the command line is used to lock the text
+ func Test_run_excmd_with_text_locked()
+ " :quit
+ let cmd = ":\<C-\>eexecute('quit')\<CR>\<C-C>"
+ call assert_fails("call feedkeys(cmd, 'xt')", 'E523:')
+
+ " :qall
+ let cmd = ":\<C-\>eexecute('qall')\<CR>\<C-C>"
+ call assert_fails("call feedkeys(cmd, 'xt')", 'E523:')
+
+ " :exit
+ let cmd = ":\<C-\>eexecute('exit')\<CR>\<C-C>"
+ call assert_fails("call feedkeys(cmd, 'xt')", 'E523:')
+
+ " :close - should be ignored
+ new
+ let cmd = ":\<C-\>eexecute('close')\<CR>\<C-C>"
+ call assert_equal(2, winnr('$'))
+ close
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0269/src/testdir/test_expand.vim 2019-11-09 17:59:44.000000000
+0100
--- src/testdir/test_expand.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 1,5 ****
--- 1,7 ----
" Test for expanding file names
+ source shared.vim
+
func Test_with_directories()
call mkdir('Xdir1')
call mkdir('Xdir2')
***************
*** 81,83 ****
--- 83,112 ----
call assert_fails('call expandcmd("make %")', 'E499:')
close
endfunc
+
+ " Test for expanding <sfile>, <slnum> and <sflnum> outside of sourcing a
script
+ func Test_source_sfile()
+ let lines =<< trim [SCRIPT]
+ :call assert_fails('echo expandcmd("<sfile>")', 'E498:')
+ :call assert_fails('echo expandcmd("<slnum>")', 'E842:')
+ :call assert_fails('echo expandcmd("<sflnum>")', 'E961:')
+ :call assert_fails('call expandcmd("edit <cfile>")', 'E446:')
+ :call assert_fails('call expandcmd("edit #")', 'E194:')
+ :call assert_fails('call expandcmd("edit #<2")', 'E684:')
+ :call assert_fails('call expandcmd("edit <cword>")', 'E348:')
+ :call assert_fails('call expandcmd("edit <cexpr>")', 'E348:')
+ :call assert_fails('autocmd User MyCmd echo "<sfile>"', 'E498:')
+ :call writefile(v:errors, 'Xresult')
+ :qall!
+
+ [SCRIPT]
+ call writefile(lines, 'Xscript')
+ if RunVim([], [], '--clean -s Xscript')
+ call assert_equal([], readfile('Xresult'))
+ endif
+ call delete('Xscript')
+ call delete('Xresult')
+ endfunc
+
+
+ " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0269/src/testdir/test_filetype.vim 2020-01-31
22:57:56.600690726 +0100
--- src/testdir/test_filetype.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 621,623 ****
--- 621,645 ----
call feedkeys(":setfiletype java\<C-A>\<C-B>\"\<CR>", 'tx')
call assert_equal('"setfiletype java javacc javascript javascriptreact', @:)
endfunc
+
+ " Test for ':filetype detect' command for a buffer without a file
+ func Test_emptybuf_ftdetect()
+ new
+ call setline(1, '#!/bin/sh')
+ call assert_equal('', &filetype)
+ filetype detect
+ call assert_equal('sh', &filetype)
+ close!
+ endfunc
+
+ " Test for ':filetype indent on' and ':filetype indent off' commands
+ func Test_filetype_indent_off()
+ new Xtest.vim
+ filetype indent on
+ call assert_equal(1, g:did_indent_on)
+ filetype indent off
+ call assert_equal(0, exists('g:did_indent_on'))
+ close
+ endfunc
+
+ " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0269/src/testdir/test_findfile.vim 2019-11-09
18:01:54.000000000 +0100
--- src/testdir/test_findfile.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 183,185 ****
--- 183,225 ----
call assert_fails('call finddir("x", "**x")', 'E343:')
call assert_fails('call finddir("x", repeat("x", 5000))', 'E854:')
endfunc
+
+ " Test for the :find, :sfind and :tabfind commands
+ func Test_find_cmd()
+ new
+ let save_path = &path
+ let save_dir = getcwd()
+ set path=.,./**/*
+ call CreateFiles()
+ cd Xdir1
+
+ " Test for :find
+ find foo
+ call assert_equal('foo', expand('%:.'))
+ 2find foo
+ call assert_equal('Xdir2/foo', expand('%:.'))
+ call assert_fails('3find foo', 'E347:')
+
+ " Test for :sfind
+ enew
+ sfind barfoo
+ call assert_equal('Xdir2/Xdir3/barfoo', expand('%:.'))
+ call assert_equal(3, winnr('$'))
+ close
+ call assert_fails('sfind baz', 'E345:')
+ call assert_equal(2, winnr('$'))
+
+ " Test for :tabfind
+ enew
+ tabfind foobar
+ call assert_equal('Xdir2/foobar', expand('%:.'))
+ call assert_equal(2, tabpagenr('$'))
+ tabclose
+ call assert_fails('tabfind baz', 'E345:')
+ call assert_equal(1, tabpagenr('$'))
+
+ call chdir(save_dir)
+ call CleanFiles()
+ let &path = save_path
+ close
+ endfunc
*** ../vim-8.2.0269/src/testdir/test_join.vim 2019-12-17 22:10:54.564370706
+0100
--- src/testdir/test_join.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 436,440 ****
--- 436,446 ----
call setline(1, ['a', 'b', '', 'c', 'd'])
normal 5J
call assert_equal('a b c d', getline(1))
+ call setline(1, ['a', 'b', 'c'])
+ 2,2join
+ call assert_equal(['a', 'b', 'c'], getline(1, '$'))
+ call assert_equal(2, line('.'))
+ 2join
+ call assert_equal(['a', 'b c'], getline(1, '$'))
bwipe!
endfunc
*** ../vim-8.2.0269/src/testdir/test_move.vim 2020-01-29 21:57:28.745607653
+0100
--- src/testdir/test_move.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 38,43 ****
--- 38,44 ----
call assert_fails("move -100", 'E16:')
call assert_fails("move +100", 'E16:')
call assert_fails('move', 'E16:')
+ call assert_fails("move 'r", 'E20:')
%bwipeout!
endfunc
*** ../vim-8.2.0269/src/testdir/test_normal.vim 2020-02-16 13:33:52.047371845
+0100
--- src/testdir/test_normal.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 2006,2012 ****
tabclose
endfor
" clean up
! call assert_fails(':tabclose', 'E784')
endfunc
fun! Test_normal38_nvhome()
--- 2006,2012 ----
tabclose
endfor
" clean up
! call assert_fails(':tabclose', 'E784:')
endfunc
fun! Test_normal38_nvhome()
*** ../vim-8.2.0269/src/testdir/test_registers.vim 2020-01-26
21:59:25.632718110 +0100
--- src/testdir/test_registers.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 386,389 ****
--- 386,400 ----
bwipe!
endfunc
+ " Test for executing a register using :@ command
+ func Test_execute_register()
+ call setreg('r', [])
+ call assert_beeps('@r')
+ let i = 1
+ let @q = 'let i+= 1'
+ @q
+ @
+ call assert_equal(3, i)
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0269/src/testdir/test_source.vim 2020-02-11 22:03:43.038846226
+0100
--- src/testdir/test_source.vim 2020-02-17 21:21:18.752112012 +0100
***************
*** 66,69 ****
--- 66,90 ----
call delete('Xfile.vim')
endfunc
+ " Test for expanding <sfile> in a autocmd and for <slnum> and <sflnum>
+ func Test_source_autocmd_sfile()
+ let code =<< trim [CODE]
+ let g:SfileName = ''
+ augroup sfiletest
+ au!
+ autocmd User UserAutoCmd let g:Sfile = '<sfile>:t'
+ augroup END
+ doautocmd User UserAutoCmd
+ let g:Slnum = expand('<slnum>')
+ let g:Sflnum = expand('<sflnum>')
+ augroup! sfiletest
+ [CODE]
+ call writefile(code, 'Xscript.vim')
+ source Xscript.vim
+ call assert_equal('Xscript.vim', g:Sfile)
+ call assert_equal('7', g:Slnum)
+ call assert_equal('8', g:Sflnum)
+ call delete('Xscript.vim')
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0269/src/testdir/test_tabpage.vim 2020-01-13
20:54:48.215608391 +0100
--- src/testdir/test_tabpage.vim 2020-02-17 21:22:44.903901214 +0100
***************
*** 139,145 ****
--- 139,149 ----
call assert_fails("tabmove -99", 'E474:')
call assert_fails("tabmove -3+", 'E474:')
call assert_fails("tabmove $3", 'E474:')
+ call assert_fails("%tabonly", 'E16:')
1tabonly!
+ tabnew
+ call assert_fails("-2tabmove", 'E474:')
+ tabonly!
endfunc
" Test autocommands
***************
*** 609,612 ****
--- 613,626 ----
call delete('XTest_tabpage_cmdheight')
endfunc
+ " Test for closing the tab page from a command window
+ func Test_tabpage_close_cmdwin()
+ tabnew
+ call feedkeys("q/:tabclose\<CR>\<Esc>", 'xt')
+ call assert_equal(2, tabpagenr('$'))
+ call feedkeys("q/:tabonly\<CR>\<Esc>", 'xt')
+ call assert_equal(2, tabpagenr('$'))
+ tabonly
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0269/src/testdir/test_tagjump.vim 2020-01-06
20:09:09.996571770 +0100
--- src/testdir/test_tagjump.vim 2020-02-17 21:21:24.056099354 +0100
***************
*** 893,898 ****
--- 893,903 ----
tag FIRST
tnext
call assert_equal(2, line('.'))
+ tlast
+ tprev
+ call assert_equal(2, line('.'))
+ tNext
+ call assert_equal(1, line('.'))
set ignorecase&
call delete('Xtags')
***************
*** 1035,1038 ****
--- 1040,1239 ----
%bwipe
endfunc
+ " Test for :isearch, :ilist, :ijump and :isplit commands
+ " Test for [i, ]i, [I, ]I, [ CTRL-I, ] CTRL-I and CTRL-W i commands
+ func Test_inc_search()
+ new
+ call setline(1, ['1:foo', '2:foo', 'foo', '3:foo', '4:foo'])
+ call cursor(3, 1)
+
+ " Test for [i and ]i
+ call assert_equal('1:foo', execute('normal [i'))
+ call assert_equal('2:foo', execute('normal 2[i'))
+ call assert_fails('normal 3[i', 'E387:')
+ call assert_equal('3:foo', execute('normal ]i'))
+ call assert_equal('4:foo', execute('normal 2]i'))
+ call assert_fails('normal 3]i', 'E389:')
+
+ " Test for :isearch
+ call assert_equal('1:foo', execute('isearch foo'))
+ call assert_equal('3:foo', execute('isearch 4 /foo/'))
+ call assert_fails('isearch 3 foo', 'E387:')
+ call assert_equal('3:foo', execute('+1,$isearch foo'))
+ call assert_fails('1,.-1isearch 3 foo', 'E389:')
+ call assert_fails('isearch bar', 'E389:')
+ call assert_fails('isearch /foo/3', 'E488:')
+
+ " Test for [I and ]I
+ call assert_equal([
+ \ ' 1: 1 1:foo',
+ \ ' 2: 2 2:foo',
+ \ ' 3: 3 foo',
+ \ ' 4: 4 3:foo',
+ \ ' 5: 5 4:foo'], split(execute('normal [I'), "\n"))
+ call assert_equal([
+ \ ' 1: 4 3:foo',
+ \ ' 2: 5 4:foo'], split(execute('normal ]I'), "\n"))
+
+ " Test for :ilist
+ call assert_equal([
+ \ ' 1: 1 1:foo',
+ \ ' 2: 2 2:foo',
+ \ ' 3: 3 foo',
+ \ ' 4: 4 3:foo',
+ \ ' 5: 5 4:foo'], split(execute('ilist foo'), "\n"))
+ call assert_equal([
+ \ ' 1: 4 3:foo',
+ \ ' 2: 5 4:foo'], split(execute('+1,$ilist /foo/'), "\n"))
+ call assert_fails('ilist bar', 'E389:')
+
+ " Test for [ CTRL-I and ] CTRL-I
+ exe "normal [\t"
+ call assert_equal([1, 3], [line('.'), col('.')])
+ exe "normal 2j4[\t"
+ call assert_equal([4, 3], [line('.'), col('.')])
+ call assert_fails("normal k3[\t", 'E387:')
+ call assert_fails("normal 6[\t", 'E389:')
+ exe "normal ]\t"
+ call assert_equal([4, 3], [line('.'), col('.')])
+ exe "normal k2]\t"
+ call assert_equal([5, 3], [line('.'), col('.')])
+ call assert_fails("normal 2k3]\t", 'E389:')
+
+ " Test for :ijump
+ call cursor(3, 1)
+ ijump foo
+ call assert_equal([1, 3], [line('.'), col('.')])
+ call cursor(3, 1)
+ ijump 4 /foo/
+ call assert_equal([4, 3], [line('.'), col('.')])
+ call cursor(3, 1)
+ call assert_fails('ijump 3 foo', 'E387:')
+ +,$ijump 2 foo
+ call assert_equal([5, 3], [line('.'), col('.')])
+ call assert_fails('ijump bar', 'E389:')
+
+ " Test for CTRL-W i
+ call cursor(3, 1)
+ wincmd i
+ call assert_equal([1, 3, 3], [line('.'), col('.'), winnr('$')])
+ close
+ 5wincmd i
+ call assert_equal([5, 3, 3], [line('.'), col('.'), winnr('$')])
+ close
+ call assert_fails('3wincmd i', 'E387:')
+ call assert_fails('6wincmd i', 'E389:')
+
+ " Test for :isplit
+ isplit foo
+ call assert_equal([1, 3, 3], [line('.'), col('.'), winnr('$')])
+ close
+ isplit 5 /foo/
+ call assert_equal([5, 3, 3], [line('.'), col('.'), winnr('$')])
+ close
+ call assert_fails('isplit 3 foo', 'E387:')
+ call assert_fails('isplit 6 foo', 'E389:')
+ call assert_fails('isplit bar', 'E389:')
+
+ close!
+ endfunc
+
+ " Test for :dsearch, :dlist, :djump and :dsplit commands
+ " Test for [d, ]d, [D, ]D, [ CTRL-D, ] CTRL-D and CTRL-W d commands
+ func Test_def_search()
+ new
+ call setline(1, ['#define FOO 1', '#define FOO 2', '#define FOO 3',
+ \ '#define FOO 4', '#define FOO 5'])
+ call cursor(3, 9)
+
+ " Test for [d and ]d
+ call assert_equal('#define FOO 1', execute('normal [d'))
+ call assert_equal('#define FOO 2', execute('normal 2[d'))
+ call assert_fails('normal 3[d', 'E387:')
+ call assert_equal('#define FOO 4', execute('normal ]d'))
+ call assert_equal('#define FOO 5', execute('normal 2]d'))
+ call assert_fails('normal 3]d', 'E388:')
+
+ " Test for :dsearch
+ call assert_equal('#define FOO 1', execute('dsearch FOO'))
+ call assert_equal('#define FOO 5', execute('dsearch 5 /FOO/'))
+ call assert_fails('dsearch 3 FOO', 'E387:')
+ call assert_equal('#define FOO 4', execute('+1,$dsearch FOO'))
+ call assert_fails('1,.-1dsearch 3 FOO', 'E388:')
+ call assert_fails('dsearch BAR', 'E388:')
+
+ " Test for [D and ]D
+ call assert_equal([
+ \ ' 1: 1 #define FOO 1',
+ \ ' 2: 2 #define FOO 2',
+ \ ' 3: 3 #define FOO 3',
+ \ ' 4: 4 #define FOO 4',
+ \ ' 5: 5 #define FOO 5'], split(execute('normal [D'), "\n"))
+ call assert_equal([
+ \ ' 1: 4 #define FOO 4',
+ \ ' 2: 5 #define FOO 5'], split(execute('normal ]D'), "\n"))
+
+ " Test for :dlist
+ call assert_equal([
+ \ ' 1: 1 #define FOO 1',
+ \ ' 2: 2 #define FOO 2',
+ \ ' 3: 3 #define FOO 3',
+ \ ' 4: 4 #define FOO 4',
+ \ ' 5: 5 #define FOO 5'], split(execute('dlist FOO'), "\n"))
+ call assert_equal([
+ \ ' 1: 4 #define FOO 4',
+ \ ' 2: 5 #define FOO 5'], split(execute('+1,$dlist /FOO/'), "\n"))
+ call assert_fails('dlist BAR', 'E388:')
+
+ " Test for [ CTRL-D and ] CTRL-D
+ exe "normal [\<C-D>"
+ call assert_equal([1, 9], [line('.'), col('.')])
+ exe "normal 2j4[\<C-D>"
+ call assert_equal([4, 9], [line('.'), col('.')])
+ call assert_fails("normal k3[\<C-D>", 'E387:')
+ call assert_fails("normal 6[\<C-D>", 'E388:')
+ exe "normal ]\<C-D>"
+ call assert_equal([4, 9], [line('.'), col('.')])
+ exe "normal k2]\<C-D>"
+ call assert_equal([5, 9], [line('.'), col('.')])
+ call assert_fails("normal 2k3]\<C-D>", 'E388:')
+
+ " Test for :djump
+ call cursor(3, 9)
+ djump FOO
+ call assert_equal([1, 9], [line('.'), col('.')])
+ call cursor(3, 9)
+ djump 4 /FOO/
+ call assert_equal([4, 9], [line('.'), col('.')])
+ call cursor(3, 9)
+ call assert_fails('djump 3 FOO', 'E387:')
+ +,$djump 2 FOO
+ call assert_equal([5, 9], [line('.'), col('.')])
+ call assert_fails('djump BAR', 'E388:')
+
+ " Test for CTRL-W d
+ call cursor(3, 9)
+ wincmd d
+ call assert_equal([1, 9, 3], [line('.'), col('.'), winnr('$')])
+ close
+ 5wincmd d
+ call assert_equal([5, 9, 3], [line('.'), col('.'), winnr('$')])
+ close
+ call assert_fails('3wincmd d', 'E387:')
+ call assert_fails('6wincmd d', 'E388:')
+
+ " Test for :dsplit
+ dsplit FOO
+ call assert_equal([1, 9, 3], [line('.'), col('.'), winnr('$')])
+ close
+ dsplit 5 /FOO/
+ call assert_equal([5, 9, 3], [line('.'), col('.'), winnr('$')])
+ close
+ call assert_fails('dsplit 3 FOO', 'E387:')
+ call assert_fails('dsplit 6 FOO', 'E388:')
+ call assert_fails('dsplit BAR', 'E388:')
+
+ close!
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0269/src/testdir/test_vimscript.vim 2020-02-11
22:03:43.042846213 +0100
--- src/testdir/test_vimscript.vim 2020-02-17 21:21:24.056099354 +0100
***************
*** 2061,2066 ****
--- 2061,2076 ----
call delete('Xscript')
endfunc
+ " Test for <sfile>, <slnum> in a function {{{1
+ func Test_sfile_in_function()
+ func Xfunc()
+ call assert_match('..Test_sfile_in_function\[5]..Xfunc',
expand('<sfile>'))
+ call assert_equal('2', expand('<slnum>'))
+ endfunc
+ call Xfunc()
+ delfunc Xfunc
+ endfunc
+
"-------------------------------------------------------------------------------
" Modelines {{{1
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
*** ../vim-8.2.0269/src/testdir/test_visual.vim 2019-12-06 20:39:15.000000000
+0100
--- src/testdir/test_visual.vim 2020-02-17 21:24:39.187606290 +0100
***************
*** 894,897 ****
--- 894,911 ----
bwipe!
endfunc
+ " Test for * register in :
+ func Test_star_register()
+ call assert_fails('*bfirst', 'E16:')
+ new
+ call setline(1, ['foo', 'bar', 'baz', 'qux'])
+ exe "normal jVj\<ESC>"
+ *yank r
+ call assert_equal("bar\nbaz\n", @r)
+
+ delmarks < >
+ call assert_fails('*yank', 'E20:')
+ close!
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0269/src/testdir/test_window_cmd.vim 2020-02-11
22:03:43.042846213 +0100
--- src/testdir/test_window_cmd.vim 2020-02-16 13:28:49.064830117 +0100
***************
*** 940,945 ****
--- 940,954 ----
new
call assert_fails('only', 'E445:')
only!
+ " Test for :only with a count
+ let wid = win_getid()
+ new
+ new
+ 3only
+ call assert_equal(1, winnr('$'))
+ call assert_equal(wid, win_getid())
+ call assert_fails('close', 'E444:')
+ call assert_fails('%close', 'E16:')
endfunc
" Test for errors with :wincmd
*** ../vim-8.2.0269/src/testdir/test_writefile.vim 2020-02-12
22:15:14.856205206 +0100
--- src/testdir/test_writefile.vim 2020-02-17 21:26:37.931284422 +0100
***************
*** 215,223 ****
close!
call assert_fails('w > Xtest', 'E494:')
!
! call assert_fails('w > Xtest', 'E494:')
!
" Try to overwrite a directory
if has('unix')
call mkdir('Xdir1')
--- 215,221 ----
close!
call assert_fails('w > Xtest', 'E494:')
!
" Try to overwrite a directory
if has('unix')
call mkdir('Xdir1')
*** ../vim-8.2.0269/src/version.c 2020-02-17 21:12:05.073229752 +0100
--- src/version.c 2020-02-17 21:29:31.562792568 +0100
***************
*** 744,745 ****
--- 744,747 ----
{ /* Add new patch number below this line */
+ /**/
+ 270,
/**/
--
>From "know your smileys":
|-P Reaction to unusually ugly C code
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202002172033.01HKXxO0014132%40masaka.moolenaar.net.