ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.42k stars 2.8k forks source link

Add tests for Vimscript #1868

Closed micbou closed 4 years ago

micbou commented 8 years ago

Currently, our only way to test the Vimscript part of YCM is to mock the Vim module. We would like to improve this situation by using a Vimscript testing framework. As far as I know, there are two kinds of Vimscript testing framework: those that are directly running Vimscript inside Vim. Examples:

We cannot use them because they don't trigger the completion menu when inserting characters. Second kind is using a client/server architecture. Examples:

They should be good candidates for YCM. We are leaning toward vimrunner-python because it is written in Python. However, it has some limitations: it does not support Windows and Python 2.6. Adding those is not difficult but since the code is rather small, it seems better to write our own implementation within YCM (like UltiSnips does).

vheon commented 8 years ago

To note that Ultisnips approach is slightly different since they don't use the client/server capabilities of vim, but rather run vim in a tmux pane and send keys to it from another pane; this is actually closer to what a real user would do but I don't know how practical it is in terms of:

Valloric commented 8 years ago

it seems better to write our own implementation within YCM

I'm fine with our own implementation, but does it have to be in the same repo? I'd prefer a separate repo if possible. (The more code we can decouple, the better.)

puremourning commented 4 years ago

Implemented simple testing framework in #3412 based on Vim's own tests.