comparison src/testdir/test_help_tagjump.vim @ 10394:1de5916d9403 v8.0.0091

commit https://github.com/vim/vim/commit/9f0e423c2818c0cacd0810f9c3c67cbb6b80963d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 17 19:48:18 2016 +0100 patch 8.0.0091 Problem: Test_help_complete sometimes fails in MS-Windows console. Solution: Use getcompletion() instead of feedkeys() and command line completion. (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Thu, 17 Nov 2016 20:00:05 +0100
parents 3ee84d270ea7
children 2edda415c28a
comparison
equal deleted inserted replaced
10393:8ec337fc15d4 10394:1de5916d9403
75 if has('multi_lang') 75 if has('multi_lang')
76 let &helplang = s:helplang_save 76 let &helplang = s:helplang_save
77 endif 77 endif
78 endfunc 78 endfunc
79 79
80 func s:get_cmd_compl_list(cmd) 80 func s:get_help_compl_list(cmd)
81 let list = [] 81 return getcompletion(a:cmd, 'help')
82 let str = ''
83 for cnt in range(1, 999)
84 call feedkeys(a:cmd . repeat("\<Tab>", cnt) . "'\<C-B>let str='\<CR>", 'tx')
85 if str ==# a:cmd[1:]
86 break
87 endif
88 call add(list, str)
89 endfor
90 return list
91 endfunc 82 endfunc
92 83
93 func Test_help_complete() 84 func Test_help_complete()
94 try 85 try
95 let list = [] 86 let list = []
97 88
98 " 'helplang=' and help file lang is 'en' 89 " 'helplang=' and help file lang is 'en'
99 if has('multi_lang') 90 if has('multi_lang')
100 set helplang= 91 set helplang=
101 endif 92 endif
102 let list = s:get_cmd_compl_list(":h test") 93 let list = s:get_help_compl_list("test")
103 call assert_equal(['h test-col', 'h test-char'], list) 94 call assert_equal(['test-col', 'test-char'], list)
104 95
105 if has('multi_lang') 96 if has('multi_lang')
106 " 'helplang=ab' and help file lang is 'en' 97 " 'helplang=ab' and help file lang is 'en'
107 set helplang=ab 98 set helplang=ab
108 let list = s:get_cmd_compl_list(":h test") 99 let list = s:get_help_compl_list("test")
109 call assert_equal(['h test-col', 'h test-char'], list) 100 call assert_equal(['test-col', 'test-char'], list)
110 101
111 " 'helplang=' and help file lang is 'en' and 'ab' 102 " 'helplang=' and help file lang is 'en' and 'ab'
112 set rtp+=Xdir1/doc-ab 103 set rtp+=Xdir1/doc-ab
113 set helplang= 104 set helplang=
114 let list = s:get_cmd_compl_list(":h test") 105 let list = s:get_help_compl_list("test")
115 call assert_equal(sort(['h test-col@en', 'h test-col@ab', 106 call assert_equal(sort(['test-col@en', 'test-col@ab',
116 \ 'h test-char@en', 'h test-char@ab']), sort(list)) 107 \ 'test-char@en', 'test-char@ab']), sort(list))
117 108
118 " 'helplang=ab' and help file lang is 'en' and 'ab' 109 " 'helplang=ab' and help file lang is 'en' and 'ab'
119 set helplang=ab 110 set helplang=ab
120 let list = s:get_cmd_compl_list(":h test") 111 let list = s:get_help_compl_list("test")
121 call assert_equal(sort(['h test-col', 'h test-col@en', 112 call assert_equal(sort(['test-col', 'test-col@en',
122 \ 'h test-char', 'h test-char@en']), sort(list)) 113 \ 'test-char', 'test-char@en']), sort(list))
123 114
124 " 'helplang=' and help file lang is 'en', 'ab' and 'ja' 115 " 'helplang=' and help file lang is 'en', 'ab' and 'ja'
125 set rtp+=Xdir1/doc-ja 116 set rtp+=Xdir1/doc-ja
126 set helplang= 117 set helplang=
127 let list = s:get_cmd_compl_list(":h test") 118 let list = s:get_help_compl_list("test")
128 call assert_equal(sort(['h test-col@en', 'h test-col@ab', 119 call assert_equal(sort(['test-col@en', 'test-col@ab',
129 \ 'h test-col@ja', 'h test-char@en', 120 \ 'test-col@ja', 'test-char@en',
130 \ 'h test-char@ab', 'h test-char@ja']), sort(list)) 121 \ 'test-char@ab', 'test-char@ja']), sort(list))
131 122
132 " 'helplang=ab' and help file lang is 'en', 'ab' and 'ja' 123 " 'helplang=ab' and help file lang is 'en', 'ab' and 'ja'
133 set helplang=ab 124 set helplang=ab
134 let list = s:get_cmd_compl_list(":h test") 125 let list = s:get_help_compl_list("test")
135 call assert_equal(sort(['h test-col', 'h test-col@en', 126 call assert_equal(sort(['test-col', 'test-col@en',
136 \ 'h test-col@ja', 'h test-char', 127 \ 'test-col@ja', 'test-char',
137 \ 'h test-char@en', 'h test-char@ja']), sort(list)) 128 \ 'test-char@en', 'test-char@ja']), sort(list))
138 129
139 " 'helplang=ab,ja' and help file lang is 'en', 'ab' and 'ja' 130 " 'helplang=ab,ja' and help file lang is 'en', 'ab' and 'ja'
140 set helplang=ab,ja 131 set helplang=ab,ja
141 let list = s:get_cmd_compl_list(":h test") 132 let list = s:get_help_compl_list("test")
142 call assert_equal(sort(['h test-col', 'h test-col@ja', 133 call assert_equal(sort(['test-col', 'test-col@ja',
143 \ 'h test-col@en', 'h test-char', 134 \ 'test-col@en', 'test-char',
144 \ 'h test-char@ja', 'h test-char@en']), sort(list)) 135 \ 'test-char@ja', 'test-char@en']), sort(list))
145 endif 136 endif
146 catch 137 catch
147 call assert_exception('X') 138 call assert_exception('X')
148 finally 139 finally
149 call s:doc_config_teardown() 140 call s:doc_config_teardown()