testing.vim is a small testing framework for Vim.
The design is loosely inspired by Go’s
My philosophy of testing is that it should be kept as simple as feasible; programming is already hard enough without struggling with a poorly documented unintuitive testing framework. This is what makes testing.vim different from some other testing Vim runners/frameworks.
testing.vim includes support for code coverage reports (via covimerage).
Tests are stored in a
*_test.vim files, all functions starting with
will be run.
It is customary – but not mandatory – to store
n_test.vim files next to the
n.vim file in the same directory.
./test /path/to/file_vim.go to run test in that file,
/path/to/dir to run all test files in a directory, or
to run al test files in a directory and all subdirectories.
A test is considered to be “failed” when
v:errors has any items. Vim’s
assert_* functions write to this, and it can also be written to as a regular
list (for logging, or writing your own testing logic).
You can filter test functions with the
-r option. See
./test -h for various
testing.vim will always use the
PATH to run tests; prepend a
different PATH to run a different
vim. For testing in CI environments (Travis,
CircleCI, etc.) I recommend vim-testbed.
There is also a small script to benchmark syntax highlighting: