vim-patch:8.1.1546: in some tests 'tags' is set but not restored

Problem:    In some tests 'tags' is set but not restored. (Daniel Hahler)
Solution:   Restore 'tags'. (closes vim/vim#4535)
0331faf712
This commit is contained in:
Daniel Hahler
2019-06-16 14:31:58 +02:00
parent 3d8e8cb889
commit c6602df015
6 changed files with 13 additions and 2 deletions

View File

@@ -635,7 +635,8 @@ func Test_OptionSet()
" Cleanup " Cleanup
au! OptionSet au! OptionSet
for opt in ['nu', 'ai', 'acd', 'ar', 'bs', 'backup', 'cul', 'cp'] " set tags&
for opt in ['nu', 'ai', 'acd', 'ar', 'bs', 'backup', 'cul', 'cp', 'tags']
exe printf(":set %s&vim", opt) exe printf(":set %s&vim", opt)
endfor endfor
call test_override('starting', 0) call test_override('starting', 0)

View File

@@ -294,6 +294,7 @@ func Test_getcompletion()
endfor endfor
call delete('Xtags') call delete('Xtags')
set tags&
call assert_fails('call getcompletion("", "burp")', 'E475:') call assert_fails('call getcompletion("", "burp")', 'E475:')
endfunc endfunc

View File

@@ -225,6 +225,7 @@ func Test_set_completion()
call feedkeys(":set tags=./\\\\ dif\<C-A>\<C-B>\"\<CR>", 'tx') call feedkeys(":set tags=./\\\\ dif\<C-A>\<C-B>\"\<CR>", 'tx')
call assert_equal('"set tags=./\\ diff diffexpr diffopt', @:) call assert_equal('"set tags=./\\ diff diffexpr diffopt', @:)
set tags&
let &shellslash = shellslash let &shellslash = shellslash
endfunc endfunc

View File

@@ -44,6 +44,7 @@ func Test_tagcase()
endfor endfor
call delete('Xtags') call delete('Xtags')
set tags&
set ic& set ic&
setg tc& setg tc&
setl tc& setl tc&

View File

@@ -20,6 +20,7 @@ func Test_cancel_ptjump()
call assert_equal(2, winnr('$')) call assert_equal(2, winnr('$'))
call delete('Xtags') call delete('Xtags')
set tags&
quit quit
endfunc endfunc
@@ -104,6 +105,7 @@ func Test_tagjump_switchbuf()
enew | only enew | only
call delete('Xfile1') call delete('Xfile1')
call delete('Xtags') call delete('Xtags')
set tags&
set switchbuf&vim set switchbuf&vim
endfunc endfunc
@@ -424,7 +426,7 @@ func Test_tagnr_recall()
tag tag
call assert_equal(bufname('%'), 'Xtest.h') call assert_equal(bufname('%'), 'Xtest.h')
set tag& set tags&
call delete('Xtags') call delete('Xtags')
bwipe Xtest.h bwipe Xtest.h
bwipe Xtest.c bwipe Xtest.c
@@ -460,6 +462,7 @@ func Test_tag_line_toolong()
endtry endtry
call assert_equal('Ignoring long line in tags file', split(execute('messages'), '\n')[-1]) call assert_equal('Ignoring long line in tags file', split(execute('messages'), '\n')[-1])
call delete('Xtags') call delete('Xtags')
set tags&
let &verbose = old_vbs let &verbose = old_vbs
endfunc endfunc

View File

@@ -16,6 +16,7 @@ func Test_taglist()
call assert_equal(['BFoo', 'FFoo'], map(taglist("Foo", "Xbar"), {i, v -> v.name})) call assert_equal(['BFoo', 'FFoo'], map(taglist("Foo", "Xbar"), {i, v -> v.name}))
call delete('Xtags') call delete('Xtags')
set tags&
bwipe bwipe
endfunc endfunc
@@ -36,6 +37,7 @@ func Test_taglist_native_etags()
\ map(taglist('set_signals'), {i, v -> [v.name, v.cmd]})) \ map(taglist('set_signals'), {i, v -> [v.name, v.cmd]}))
call delete('Xtags') call delete('Xtags')
set tags&
endfunc endfunc
func Test_taglist_ctags_etags() func Test_taglist_ctags_etags()
@@ -55,6 +57,7 @@ func Test_taglist_ctags_etags()
\ map(taglist('set_signals'), {i, v -> [v.name, v.cmd]})) \ map(taglist('set_signals'), {i, v -> [v.name, v.cmd]}))
call delete('Xtags') call delete('Xtags')
set tags&
endfunc endfunc
func Test_tags_too_long() func Test_tags_too_long()
@@ -73,6 +76,7 @@ func Test_tagsfile_without_trailing_newline()
call assert_equal('Foo', tl[0].name) call assert_equal('Foo', tl[0].name)
call delete('Xtags') call delete('Xtags')
set tags&
endfunc endfunc
func Test_tagfiles() func Test_tagfiles()