@@ -119,6 +119,7 @@ func Test_cscopeWithCscopeConnections()
119119 endfor
120120
121121 " Test: Invalid find command
122+ call assert_fails (' cs find' , ' E560:' )
122123 call assert_fails (' cs find x' , ' E560:' )
123124
124125 if has (' float' )
@@ -180,12 +181,19 @@ func Test_cscopeWithCscopeConnections()
180181 let a = execute (' cstag TEST_COUNT' )
181182 call assert_match (' (1 of 1): <<TEST_COUNT>> #define TEST_COUNT 50000' , a )
182183 call assert_equal (' #define TEST_COUNT 50000' , getline (' .' ))
184+ call assert_fails (' cstag DOES_NOT_EXIST' , ' E257:' )
183185 set csto = 1
184186 let a = execute (' cstag index_to_key' )
185187 call assert_match (' (1 of 1): <<index_to_key>> #define index_to_key(i) ((i) ^ 15167)' , a )
186188 call assert_equal (' #define index_to_key(i) ((i) ^ 15167)' , getline (' .' ))
187- call assert_fails (' cstag xxx ' , ' E257:' )
189+ call assert_fails (' cstag DOES_NOT_EXIST ' , ' E257:' )
188190 call assert_fails (' cstag' , ' E562:' )
191+ let save_tags = &tags
192+ set tags =
193+ call assert_fails (' cstag DOES_NOT_EXIST' , ' E257:' )
194+ let a = execute (' cstag index_to_key' )
195+ call assert_match (' (1 of 1): <<index_to_key>> #define index_to_key(i) ((i) ^ 15167)' , a )
196+ let &tags = save_tags
189197
190198 " Test: 'cst' option
191199 set nocst
@@ -209,12 +217,16 @@ func Test_cscopeWithCscopeConnections()
209217 cd ..
210218 call delete (' Xcscoperelative' , ' d' )
211219
220+ " Test: E259: no match found
221+ call assert_fails (' cscope find g DOES_NOT_EXIST' , ' E259:' )
222+
212223 " Test: this should trigger call to cs_print_tags()
213224 " Unclear how to check result though, we just exercise the code.
214225 set cst cscopequickfix = s0
215226 call feedkeys (" :cs find s main\<CR> " , ' t' )
216227
217228 " Test: cscope kill
229+ call assert_fails (' cscope kill' , ' E560:' )
218230 call assert_fails (' cscope kill 2' , ' E261:' )
219231 call assert_fails (' cscope kill xxx' , ' E261:' )
220232
0 commit comments