annotate src/testdir/test_taglist.vim @ 29242:8095f317cb9c

Added tag v8.2.5139 for changeset 1690417aeafe90466566af14fcffacf3c19c1ba1
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 Jun 2022 13:15:03 +0200
parents bfa81ded42e2
children c8ebe35b2475
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14232
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
1 " test taglist(), tagfiles() functions and :tags command
11225
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
3 source check.vim
19679
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
4 source view_util.vim
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
5
11225
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 func Test_taglist()
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 call writefile([
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 \ "FFoo\tXfoo\t1",
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 \ "FBar\tXfoo\t2",
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 \ "BFoo\tXbar\t1",
15808
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 14232
diff changeset
11 \ "BBar\tXbar\t2",
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 14232
diff changeset
12 \ "Kindly\tXbar\t3;\"\tv\tfile:",
19617
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
13 \ "Lambda\tXbar\t3;\"\tλ\tfile:",
15808
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 14232
diff changeset
14 \ "Command\tXbar\tcall cursor(3, 4)|;\"\td",
11225
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 \ ], 'Xtags')
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 set tags=Xtags
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 split Xtext
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 call assert_equal(['FFoo', 'BFoo'], map(taglist("Foo"), {i, v -> v.name}))
18031
8a2fb21c23c0 patch 8.1.2011: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17093
diff changeset
20 call assert_equal(['FFoo', 'BFoo'], map("Foo"->taglist("Xtext"), {i, v -> v.name}))
11225
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call assert_equal(['FFoo', 'BFoo'], map(taglist("Foo", "Xfoo"), {i, v -> v.name}))
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call assert_equal(['BFoo', 'FFoo'], map(taglist("Foo", "Xbar"), {i, v -> v.name}))
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23
19617
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
24 let kindly = taglist("Kindly")
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
25 call assert_equal(1, len(kindly))
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
26 call assert_equal('v', kindly[0]['kind'])
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
27 call assert_equal('3', kindly[0]['cmd'])
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
28 call assert_equal(1, kindly[0]['static'])
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
29 call assert_equal('Xbar', kindly[0]['filename'])
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
30
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
31 let lambda = taglist("Lambda")
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
32 call assert_equal(1, len(lambda))
5ce724c60c4c patch 8.2.0365: tag kind can't be a multi-byte character
Bram Moolenaar <Bram@vim.org>
parents: 19055
diff changeset
33 call assert_equal('λ', lambda[0]['kind'])
15808
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 14232
diff changeset
34
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 14232
diff changeset
35 let cmd = taglist("Command")
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 14232
diff changeset
36 call assert_equal(1, len(cmd))
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 14232
diff changeset
37 call assert_equal('d', cmd[0]['kind'])
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 14232
diff changeset
38 call assert_equal('call cursor(3, 4)', cmd[0]['cmd'])
37d31fc37a5a patch 8.1.0911: tag line with Ex command cannot have extra fields
Bram Moolenaar <Bram@vim.org>
parents: 14232
diff changeset
39
27986
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
40 " Use characters with value > 127 in the tag extra field.
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
41 call writefile([
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
42 \ "vFoo\tXfoo\t4" .. ';"' .. "\ttypename:int\ta£££\tv",
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
43 \ ], 'Xtags')
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
44 call assert_equal('v', taglist('vFoo')[0].kind)
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
45
19783
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19679
diff changeset
46 call assert_fails("let l=taglist([])", 'E730:')
546bdeef35f1 patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents: 19679
diff changeset
47
11225
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 call delete('Xtags')
17093
5cda6165a5c1 patch 8.1.1546: in some tests 'tags' is set but not restored
Bram Moolenaar <Bram@vim.org>
parents: 16190
diff changeset
49 set tags&
11225
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 bwipe
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 endfunc
d3415ec1cdaf patch 8.0.0499: taglist() does not prioritize tags for a buffer
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52
11329
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
53 func Test_taglist_native_etags()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
54 CheckFeature emacs_tags
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
55
11329
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
56 call writefile([
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
57 \ "\x0c",
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
58 \ "src/os_unix.c,13491",
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
59 \ "set_signals(\x7f1335,32699",
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
60 \ "reset_signals(\x7f1407,34136",
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
61 \ ], 'Xtags')
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
62
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
63 set tags=Xtags
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
64
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
65 call assert_equal([['set_signals', '1335,32699'], ['reset_signals', '1407,34136']],
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
66 \ map(taglist('set_signals'), {i, v -> [v.name, v.cmd]}))
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
67
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
68 call delete('Xtags')
17093
5cda6165a5c1 patch 8.1.1546: in some tests 'tags' is set but not restored
Bram Moolenaar <Bram@vim.org>
parents: 16190
diff changeset
69 set tags&
11329
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
70 endfunc
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
71
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
72 func Test_taglist_ctags_etags()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
73 CheckFeature emacs_tags
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
74
11329
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
75 call writefile([
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
76 \ "\x0c",
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
77 \ "src/os_unix.c,13491",
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
78 \ "set_signals(void)\x7fset_signals\x011335,32699",
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
79 \ "reset_signals(void)\x7freset_signals\x011407,34136",
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
80 \ ], 'Xtags')
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
81
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
82 set tags=Xtags
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
83
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
84 call assert_equal([['set_signals', '1335,32699'], ['reset_signals', '1407,34136']],
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
85 \ map(taglist('set_signals'), {i, v -> [v.name, v.cmd]}))
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
86
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
87 call delete('Xtags')
17093
5cda6165a5c1 patch 8.1.1546: in some tests 'tags' is set but not restored
Bram Moolenaar <Bram@vim.org>
parents: 16190
diff changeset
88 set tags&
11329
c7ba89661c39 patch 8.0.0550: cannot parse some etags format tags file
Christian Brabandt <cb@256bit.org>
parents: 11225
diff changeset
89 endfunc
13068
63fdea6e9c6c patch 8.0.1409: buffer overflow in :tags command
Christian Brabandt <cb@256bit.org>
parents: 11329
diff changeset
90
63fdea6e9c6c patch 8.0.1409: buffer overflow in :tags command
Christian Brabandt <cb@256bit.org>
parents: 11329
diff changeset
91 func Test_tags_too_long()
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
92 call assert_fails('tag ' . repeat('x', 1020), ['E433:', 'E426:'])
13068
63fdea6e9c6c patch 8.0.1409: buffer overflow in :tags command
Christian Brabandt <cb@256bit.org>
parents: 11329
diff changeset
93 tags
63fdea6e9c6c patch 8.0.1409: buffer overflow in :tags command
Christian Brabandt <cb@256bit.org>
parents: 11329
diff changeset
94 endfunc
14232
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
95
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
96 func Test_tagfiles()
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
97 call assert_equal([], tagfiles())
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
98
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
99 call writefile(["FFoo\tXfoo\t1"], 'Xtags1')
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
100 call writefile(["FBar\tXbar\t1"], 'Xtags2')
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
101 set tags=Xtags1,Xtags2
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
102 call assert_equal(['Xtags1', 'Xtags2'], tagfiles())
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
103
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
104 help
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
105 let tf = tagfiles()
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
106 call assert_equal(1, len(tf))
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
107 call assert_equal(fnamemodify(expand('$VIMRUNTIME/doc/tags'), ':p:gs?\\?/?'),
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
108 \ fnamemodify(tf[0], ':p:gs?\\?/?'))
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
109 helpclose
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
110 call assert_equal(['Xtags1', 'Xtags2'], tagfiles())
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
111 set tags&
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
112 call assert_equal([], tagfiles())
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
113
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
114 call delete('Xtags1')
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
115 call delete('Xtags2')
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
116 bd
4afe2386aae8 patch 8.1.0133: tagfiles() can have duplicate entries
Christian Brabandt <cb@256bit.org>
parents: 13068
diff changeset
117 endfunc
16190
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
118
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
119 " For historical reasons we support a tags file where the last line is missing
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
120 " the newline.
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
121 func Test_tagsfile_without_trailing_newline()
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
122 call writefile(["Foo\tfoo\t1"], 'Xtags', 'b')
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
123 set tags=Xtags
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
124
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
125 let tl = taglist('.*')
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
126 call assert_equal(1, len(tl))
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
127 call assert_equal('Foo', tl[0].name)
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
128
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
129 call delete('Xtags')
17093
5cda6165a5c1 patch 8.1.1546: in some tests 'tags' is set but not restored
Bram Moolenaar <Bram@vim.org>
parents: 16190
diff changeset
130 set tags&
16190
d863beec391a patch 8.1.1100: tag file without trailing newline no longer works
Bram Moolenaar <Bram@vim.org>
parents: 15808
diff changeset
131 endfunc
19055
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
132
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
133 " Test for ignoring comments in a tags file
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
134 func Test_tagfile_ignore_comments()
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
135 call writefile([
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
136 \ "!_TAG_PROGRAM_NAME /Test tags generator/",
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
137 \ "FBar\tXfoo\t2" .. ';"' .. "\textrafield\tf",
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
138 \ "!_TAG_FILE_FORMAT 2 /extended format/",
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
139 \ ], 'Xtags')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
140 set tags=Xtags
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
141
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
142 let l = taglist('.*')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
143 call assert_equal(1, len(l))
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
144 call assert_equal('FBar', l[0].name)
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
145
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
146 set tags&
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
147 call delete('Xtags')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
148 endfunc
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
149
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
150 " Test for using an excmd in a tags file to position the cursor (instead of a
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
151 " search pattern or a line number)
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
152 func Test_tagfile_excmd()
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
153 call writefile([
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
154 \ "vFoo\tXfoo\tcall cursor(3, 4)" .. '|;"' .. "\tv",
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
155 \ ], 'Xtags')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
156 set tags=Xtags
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
157
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
158 let l = taglist('.*')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
159 call assert_equal([{
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
160 \ 'cmd' : 'call cursor(3, 4)',
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
161 \ 'static' : 0,
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
162 \ 'name' : 'vFoo',
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
163 \ 'kind' : 'v',
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
164 \ 'filename' : 'Xfoo'}], l)
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
165
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
166 set tags&
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
167 call delete('Xtags')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
168 endfunc
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
169
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
170 " Test for duplicate fields in a tag in a tags file
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
171 func Test_duplicate_field()
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
172 call writefile([
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
173 \ "vFoo\tXfoo\t4" .. ';"' .. "\ttypename:int\ttypename:int\tv",
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
174 \ ], 'Xtags')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
175 set tags=Xtags
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
176
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
177 let l = taglist('.*')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
178 call assert_equal([{
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
179 \ 'cmd' : '4',
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
180 \ 'static' : 0,
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
181 \ 'name' : 'vFoo',
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
182 \ 'kind' : 'v',
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
183 \ 'typename' : 'int',
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
184 \ 'filename' : 'Xfoo'}], l)
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
185
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
186 set tags&
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
187 call delete('Xtags')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
188 endfunc
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
189
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
190 " Test for tag address with ;
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
191 func Test_tag_addr_with_semicolon()
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
192 call writefile([
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
193 \ "Func1\tXfoo\t6;/^Func1/" .. ';"' .. "\tf"
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
194 \ ], 'Xtags')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
195 set tags=Xtags
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
196
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
197 let l = taglist('.*')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
198 call assert_equal([{
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
199 \ 'cmd' : '6;/^Func1/',
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
200 \ 'static' : 0,
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
201 \ 'name' : 'Func1',
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
202 \ 'kind' : 'f',
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
203 \ 'filename' : 'Xfoo'}], l)
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
204
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
205 set tags&
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
206 call delete('Xtags')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
207 endfunc
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
208
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
209 " Test for format error in a tags file
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
210 func Test_format_error()
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
211 call writefile(['vFoo-Xfoo-4'], 'Xtags')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
212 set tags=Xtags
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
213
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
214 let caught_exception = v:false
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
215 try
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
216 let l = taglist('.*')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
217 catch /E431:/
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
218 " test succeeded
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
219 let caught_exception = v:true
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
220 catch
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
221 call assert_report('Caught ' . v:exception . ' in ' . v:throwpoint)
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
222 endtry
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
223 call assert_true(caught_exception)
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
224
27986
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
225 " no field after the filename for a tag
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
226 call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//",
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
227 \ "foo\tXfile"], 'Xtags')
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
228 call assert_fails("echo taglist('foo')", 'E431:')
c724906134a3 patch 8.2.4518: the binary tag search feature is always enabled
Bram Moolenaar <Bram@vim.org>
parents: 26492
diff changeset
229
19055
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
230 set tags&
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
231 call delete('Xtags')
8645b73b3645 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
232 endfunc
19679
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
233
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
234 " Test for :tag command completion with 'wildoptions' set to 'tagfile'
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
235 func Test_tag_complete_wildoptions()
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
236 call writefile(["foo\ta.c\t10;\"\tf", "bar\tb.c\t20;\"\td"], 'Xtags')
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
237 set tags=Xtags
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
238 set wildoptions=tagfile
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
239
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
240 call feedkeys(":tag \<C-D>\<C-R>=Screenline(&lines - 1)\<CR> : "
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
241 \ .. "\<C-R>=Screenline(&lines - 2)\<CR>\<C-B>\"\<CR>", 'xt')
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
242
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
243 call assert_equal('"tag bar d b.c : foo f a.c', @:)
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
244
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
245 call delete('Xtags')
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
246 set wildoptions&
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
247 set tags&
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
248 endfunc
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
249
26492
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
250 func Test_tag_complete_with_overlong_line()
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
251 let tagslines =<< trim END
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
252 !_TAG_FILE_FORMAT 2 //
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
253 !_TAG_FILE_SORTED 1 //
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
254 !_TAG_FILE_ENCODING utf-8 //
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
255 inboundGSV a 1;" r
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
256 inboundGovernor a 2;" kind:⊢ type:forall (muxMode :: MuxMode) socket peerAddr versionNumber m a b. (MonadAsync m, MonadCatch m, MonadEvaluate m, MonadThrow m, MonadThrow (STM m), MonadTime m, MonadTimer m, MonadMask m, Ord peerAddr, HasResponder muxMode ~ True) => Tracer m (RemoteTransitionTrace peerAddr) -> Tracer m (InboundGovernorTrace peerAddr) -> ServerControlChannel muxMode peerAddr ByteString m a b -> DiffTime -> MuxConnectionManager muxMode socket peerAddr versionNumber ByteString m a b -> StrictTVar m InboundGovernorObservableState -> m Void
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
257 inboundGovernorCounters a 3;" kind:⊢ type:InboundGovernorState muxMode peerAddr m a b -> InboundGovernorCounters
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
258 END
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
259 call writefile(tagslines, 'Xtags')
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
260 set tags=Xtags
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
261
28057
bfa81ded42e2 patch 8.2.4553: linear tag search is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 27986
diff changeset
262 " try with binary search
bfa81ded42e2 patch 8.2.4553: linear tag search is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 27986
diff changeset
263 set tagbsearch
26492
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
264 call feedkeys(":tag inbou\<C-A>\<C-B>\"\<CR>", 'xt')
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
265 call assert_equal('"tag inboundGSV inboundGovernor inboundGovernorCounters', @:)
28057
bfa81ded42e2 patch 8.2.4553: linear tag search is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 27986
diff changeset
266 " try with linear search
bfa81ded42e2 patch 8.2.4553: linear tag search is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 27986
diff changeset
267 set notagbsearch
bfa81ded42e2 patch 8.2.4553: linear tag search is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 27986
diff changeset
268 call feedkeys(":tag inbou\<C-A>\<C-B>\"\<CR>", 'xt')
bfa81ded42e2 patch 8.2.4553: linear tag search is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 27986
diff changeset
269 call assert_equal('"tag inboundGSV inboundGovernor inboundGovernorCounters', @:)
bfa81ded42e2 patch 8.2.4553: linear tag search is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 27986
diff changeset
270 set tagbsearch&
26492
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
271
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
272 call delete('Xtags')
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
273 set tags&
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
274 endfunc
08e3eee541ac patch 8.2.3776: when a tags file line is long a tag may not be found
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
275
19679
9199f34d838e patch 8.2.0396: cmdexpand.c insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19617
diff changeset
276 " vim: shiftwidth=2 sts=2 expandtab