Hi Dominique, 2016年8-7(Sun) 9:35:09 UTC+9 Dominique Pelle: > On Fri, Aug 5, 2016 at 11:58 AM, h_east <[email protected]> wrote: > > Hi, > > > > 2016-8-5(Fri) 18:31:14 UTC+9 Christian Brabandt: > >> Hi Dominique! > >> > >> On Do, 04 Aug 2016, Dominique Pellé wrote: > >> > >> > Attached patch improves coverage of cscope tests. > >> > >> Great! > >> > >> > >> > cscope command line completion is still not tested. > >> > I'm not sure how it could be tested. i.e. how to check > >> > for example that the output of... > >> > > >> > :cscope find <C-D> > >> > > >> > ... is: > >> > > >> > a c d e f g i s t > >> > >> Yeah, looks like this is hard to get. I played around with > >> :echo getcompletion('find', 'cscope') -> returns ['find'] > >> :echo getcompletion('find *', 'cscope') -> returns [] > >> :echo getcompletion('', 'cscope') -> returns ['add', 'find', 'help', > >> 'kill', 'reset', 'show'] > >> so this does not work. > >> > >> Tried: > >> :let cmd=":cscope find \<c-d>\<esc>" > >> :let a=execute(':call feedkeys(cmd, "t")') > >> -> this outputs the result, but does not capture it > >> (same happens with :redir) > >> > >> > >> So I am not sure, how to test the commandline completion. > > > > Below might be helpful? > > Test_packadd_completion() in src/testdir/test_packadd.vim > > Thanks Hirohito. Inspired from Test_packadd_completion(), > I found a more compact way of testing completion using: > > call feedkeys(":cs \<C-A>\<C-B>\"\<CR>", 'tx') > call assert_equal('"cs add find help kill reset show', @:) > > call feedkeys(":cs find \<C-A>\<C-B>\"\<CR>", 'tx') > call assert_equal('"cs find a c d e f g i s t', @:)
Oh! Nice solution! I also use in the near future. Thank you. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
