diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-07 03:04:19 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-07 03:21:26 -0400 |
| commit | f4e5cd200afb72cb6f8a1f7af04f9dfff9d9c6e5 (patch) | |
| tree | dca2930236232cbb8af10accd9333d34e13ca064 /src/nvim/testdir | |
| parent | f76792a10bfc1f9a55b742e289cd73be13fbf245 (diff) | |
| download | rneovim-f4e5cd200afb72cb6f8a1f7af04f9dfff9d9c6e5.tar.gz rneovim-f4e5cd200afb72cb6f8a1f7af04f9dfff9d9c6e5.tar.bz2 rneovim-f4e5cd200afb72cb6f8a1f7af04f9dfff9d9c6e5.zip | |
vim-patch:8.1.0133: tagfiles() can have duplicate entries
Problem: tagfiles() can have duplicate entries.
Solution: Simplify the filename to make checking for duplicates work better.
Add a test. (Dominique Pelle, closes vim/vim#2979)
https://github.com/vim/vim/commit/46577b5e5445c4aaa1e7ae1764373d11dae71663
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_taglist.vim | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_taglist.vim b/src/nvim/testdir/test_taglist.vim index f4e939254a..ea0a6b9678 100644 --- a/src/nvim/testdir/test_taglist.vim +++ b/src/nvim/testdir/test_taglist.vim @@ -1,4 +1,4 @@ -" test 'taglist' function and :tags command +" test taglist(), tagfiles() functions and :tags command func Test_taglist() call writefile([ @@ -74,3 +74,26 @@ func Test_tagsfile_without_trailing_newline() call delete('Xtags') endfunc + +func Test_tagfiles() + call assert_equal([], tagfiles()) + + call writefile(["FFoo\tXfoo\t1"], 'Xtags1') + call writefile(["FBar\tXbar\t1"], 'Xtags2') + set tags=Xtags1,Xtags2 + call assert_equal(['Xtags1', 'Xtags2'], tagfiles()) + + help + let tf = tagfiles() + call assert_equal(1, len(tf)) + call assert_equal(fnamemodify(expand('$VIMRUNTIME/doc/tags'), ':p:gs?\\?/?'), + \ fnamemodify(tf[0], ':p:gs?\\?/?')) + helpclose + call assert_equal(['Xtags1', 'Xtags2'], tagfiles()) + set tags& + call assert_equal([], tagfiles()) + + call delete('Xtags1') + call delete('Xtags2') + bd +endfunc |