aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-10 18:35:00 +0200
committerGitHub <noreply@github.com>2019-08-10 18:35:00 +0200
commitd8d371994103a965365349b6ca51a0ce9c2fb4f8 (patch)
tree2a0b0689e8d0f63a41ef0735123f87dff5d55ba4 /src/nvim/testdir
parent5f243fc68ad0ab9c3bdf484c8f2753ec9414bf37 (diff)
parentac395411cd3f174f3914781f1ce10be15c7b385c (diff)
downloadrneovim-d8d371994103a965365349b6ca51a0ce9c2fb4f8.tar.gz
rneovim-d8d371994103a965365349b6ca51a0ce9c2fb4f8.tar.bz2
rneovim-d8d371994103a965365349b6ca51a0ce9c2fb4f8.zip
Merge #10737 from blueyed/vim-8.1.0911
vim-patch:8.1.0911: tag line with Ex command cannot have extra fields
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_taglist.vim44
1 files changed, 29 insertions, 15 deletions
diff --git a/src/nvim/testdir/test_taglist.vim b/src/nvim/testdir/test_taglist.vim
index fb8c6c85cd..eb64e59509 100644
--- a/src/nvim/testdir/test_taglist.vim
+++ b/src/nvim/testdir/test_taglist.vim
@@ -5,7 +5,9 @@ func Test_taglist()
\ "FFoo\tXfoo\t1",
\ "FBar\tXfoo\t2",
\ "BFoo\tXbar\t1",
- \ "BBar\tXbar\t2"
+ \ "BBar\tXbar\t2",
+ \ "Kindly\tXbar\t3;\"\tv\tfile:",
+ \ "Command\tXbar\tcall cursor(3, 4)|;\"\td",
\ ], 'Xtags')
set tags=Xtags
split Xtext
@@ -15,6 +17,18 @@ func Test_taglist()
call assert_equal(['FFoo', 'BFoo'], map(taglist("Foo", "Xfoo"), {i, v -> v.name}))
call assert_equal(['BFoo', 'FFoo'], map(taglist("Foo", "Xbar"), {i, v -> v.name}))
+ let kind = taglist("Kindly")
+ call assert_equal(1, len(kind))
+ call assert_equal('v', kind[0]['kind'])
+ call assert_equal('3', kind[0]['cmd'])
+ call assert_equal(1, kind[0]['static'])
+ call assert_equal('Xbar', kind[0]['filename'])
+
+ let cmd = taglist("Command")
+ call assert_equal(1, len(cmd))
+ call assert_equal('d', cmd[0]['kind'])
+ call assert_equal('call cursor(3, 4)', cmd[0]['cmd'])
+
call delete('Xtags')
set tags&
bwipe
@@ -65,20 +79,6 @@ func Test_tags_too_long()
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')
- set tags&
-endfunc
-
func Test_tagfiles()
call assert_equal([], tagfiles())
@@ -102,3 +102,17 @@ func Test_tagfiles()
call delete('Xtags2')
bd
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')
+ set tags&
+endfunc