diff src/testdir/test_taglist.vim @ 15808:37d31fc37a5a v8.1.0911

patch 8.1.0911: tag line with Ex command cannot have extra fields commit https://github.com/vim/vim/commit/943e9639a9ecb08bdec78ae6695c917bca6210b9 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 13 21:19:14 2019 +0100 patch 8.1.0911: tag line with Ex command cannot have extra fields Problem: Tag line with Ex command cannot have extra fields. Solution: Recognize |;" as the end of the command. (closes https://github.com/vim/vim/issues/2402)
author Bram Moolenaar <Bram@vim.org>
date Wed, 13 Feb 2019 21:30:06 +0100
parents 4afe2386aae8
children d863beec391a
line wrap: on
line diff
--- a/src/testdir/test_taglist.vim
+++ b/src/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')
   bwipe
 endfunc