diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-03 00:30:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-03 00:30:24 +0200 |
| commit | c395cf018d48f919d0a6ad3c6747142f54f693b9 (patch) | |
| tree | c5f2917772213b65c70a357a1d3db5a83450b0ab /src/nvim/testdir | |
| parent | 5134b22ac5dbc7a56b580e4cee48d1cf41eb7ab6 (diff) | |
| parent | a79c0c8f7a8bb09a5d3eda9799851e271e986579 (diff) | |
| download | rneovim-c395cf018d48f919d0a6ad3c6747142f54f693b9.tar.gz rneovim-c395cf018d48f919d0a6ad3c6747142f54f693b9.tar.bz2 rneovim-c395cf018d48f919d0a6ad3c6747142f54f693b9.zip | |
Merge #9823 from mhinz/vim-8.1.1093
vim-patch:8.1.{1093,1094,1100}
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_tagjump.vim | 31 | ||||
| -rw-r--r-- | src/nvim/testdir/test_taglist.vim | 13 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_tagjump.vim b/src/nvim/testdir/test_tagjump.vim index 180738a7c9..ad1f5fab73 100644 --- a/src/nvim/testdir/test_tagjump.vim +++ b/src/nvim/testdir/test_tagjump.vim @@ -331,4 +331,35 @@ func Test_tagnr_recall() call delete('Xtest.c') endfunc +func Test_tag_line_toolong() + call writefile([ + \ '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 django/contrib/admin/templates/admin/edit_inline/stacked.html 16;" j line:16 language:HTML' + \ ], 'Xtags') + set tags=Xtags + let old_vbs = &verbose + set verbose=5 + " ":tjump" should give "tag not found" not "Format error in tags file" + call assert_fails('tj /foo', 'E426') + try + tj /foo + catch /^Vim\%((\a\+)\)\=:E431/ + call assert_report(v:exception) + catch /.*/ + endtry + call assert_equal('Ignoring long line in tags file', split(execute('messages'), '\n')[-1]) + call writefile([ + \ '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 django/contrib/admin/templates/admin/edit_inline/stacked.html 16;" j line:16 language:HTML' + \ ], 'Xtags') + call assert_fails('tj /foo', 'E426') + try + tj /foo + catch /^Vim\%((\a\+)\)\=:E431/ + call assert_report(v:exception) + catch /.*/ + endtry + call assert_equal('Ignoring long line in tags file', split(execute('messages'), '\n')[-1]) + call delete('Xtags') + let &verbose = old_vbs +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/testdir/test_taglist.vim b/src/nvim/testdir/test_taglist.vim index 3ad2025915..f4e939254a 100644 --- a/src/nvim/testdir/test_taglist.vim +++ b/src/nvim/testdir/test_taglist.vim @@ -61,3 +61,16 @@ func Test_tags_too_long() call assert_fails('tag ' . repeat('x', 1020), 'E426') tags endfunc + +" For historical reasons we support a tags file where the last line is missing +" the newline. +func Test_tagsfile_without_trailing_newline() + call writefile(["Foo\tfoo\t1"], 'Xtags', 'b') + set tags=Xtags + + let tl = taglist('.*') + call assert_equal(1, len(tl)) + call assert_equal('Foo', tl[0].name) + + call delete('Xtags') +endfunc |