stunter.vim : stunter.vim: run vim test
script karma |
Rating 0/0,
Downloaded by 732 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Anders Thøgersen |
|
script type |
utility |
|
description |
Stunter is for running test of vim scripts.
Here is a sample script:
runtime stunter.vim
" Need this to get the script id of the script being tested
fun! s:SID()
return matchstr(expand('<sfile>'), '<SNR>\\zs\\d\\+\\ze_SID$')
endfun
" Get the Test(functionName, arguments, expectedReturnValue) function
let Test = Stunter(s:SID())
fun! s:TestMe1(a)
return 30 + a:a
endfun
fun! g:TestMe2(a)
return 10 * a:a
endfun
fun! TestMe3(a, b)
return a:a + a:b
endfun
call Test('s:TestMe1', [12], 42)
call Test('g:TestMe2', [12], 120)
call Test('TestMe3', [100, 8], 108)
If you `:source` a file with the above contents it should output:
ok..1 s:TestMe1(12) == 42
ok..2 g:TestMe2(12) == 120
ok..3 TestMe3(100, 8) == 108
Please report bugs and issues here:
https://github.com/aklt/stunter.vim/issues
|
|
install details |
unpack stunter.vim.zip from your ~/.vim directory or clone it from https://github.com/aklt/stunter.vim
using your favorite vim plugin manager. |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 3.239.76.211
|