themis.vim is a testing framework for Vim script. See help for details.
CI Service | Status |
---|---|
AppVeyor | |
CircleCI | |
GitHub Actions | |
Semaphore |
A testing framework for Vim script.
License: zlib License
themis.vim is a testing framework for Vim script. See help for details.
CI Service | Status |
---|---|
AppVeyor | |
CircleCI | |
GitHub Actions | |
Semaphore |
No
F...
I hope F will be red and . will be green
Is it possible to highlight more information such as function name?
Hi,
is there a way to test code that uses input()
or similar prompt functions?
For example, how to test this?
let g:added_name = ''
function! AddName() abort
let g:added_name = input('Enter name', '')
endfunction
when i try to call the function from test, it just stucks:
let s:suite = themis#suite('Test add name')
function! s:suite.test_add_name() abort
call AddName()
endfunction
Only way i found is to wrap it in a function, and then mock it in the test. Is there maybe a better way?
Does themis have a plan to support the test with mock object, like kannokanno/vmock?
This should be useful for a vim plugin which is painful to write tests for some reasons.
for example, calling external programs, GUI, and so on.
tyru/open-browser.vim#16
Is there currently a way to test script functions without creating an autoloading function for it?
for example if I have the following script:
" autoload/talk.vim
function! s:Greet(name) abort
return "Hello " . a:name . ", how are you?"
endfunction
it would be cool to have a helper so I can do:
" test/talk.vim
let s:suite = themis#suite('talk')
let s:assert = themis#helper('assert')
let s:talk = themis#scope('autoload/talk.vim')
function! s:suite.greet_makes_welcome_message()
let l:welcome_message = s:talk.Greet('Nic')
call s:assert.equals(l:welcome_message, 'Hello Nic, how are you?')
endfunction
Is this something that already exists? at the moment I'm sticking the following in my .themisrc and it feels quite messy:
let s:scriptnames_output = ""
let s:_scriptnames = []
function! s:scriptnames () abort
redir => s:scriptnames_output
silent scriptnames
redir END
let l:lines = split(s:scriptnames_output, "\n")
let s:_scriptnames = map(l:lines, 'matchlist(v:val, ''^\s*\(\d\+\):\s*\(.\+\)$'')')
return s:_scriptnames
endfunction
function! ForceLoad(namespace) abort
try
cal call(a:namespace . '#load', [])
catch
endtry
endfunction
function! GetSID(path) abort
let l:matches = filter(copy(s:scriptnames()), 'v:val[2] =~ ''^.*' . a:path .'$''')
if len(l:matches) < 1
throw 'No matches found for path: ' . a:path
endif
if len(l:matches) > 1
throw 'Multiple matches found for path: ' . a:path
endif
return str2nr(l:matches[0][1])
endfunction
function! ScriptCall(sid, name, ...) abort
return call('<SNR>' . a:sid . '_' . a:name, a:000)
endfunction
An exception, Vim(call):E117: Unknown function: <SNR>18_themis_vimspec_scope_4
, occur when sudo add-apt-repository ppa:pi-rho/dev -y
is executed in install
section of travis (mean Vim 7.4 is OK but Vim 7.3).
It worked previously thus probably I introduced some version dependent codes and the changes triggered the exception. However, the error message is not helped full thus I wonder if vim-themis can provide more user-friendly error message even in Vim 7.3
I know vim-themis does not officially support Vim 7.3 but vital.vim also test them functions in Vim 7.3 thus I'll be happy if you consider about this little issue.
お時間があればで結構ですので、よろしくお願いいたします。
call themis#helper('command').with(themis#helper('assert'))
Describe test
It should not crash
let d = {}
let d.x = d
Assert IsNone(d)
End
End
Put this file as foo.vimspec
and run
$ /path/to/vim-themis/bin/themis foo.vimspec
It shows failure message correctly
It crashes with Vim exception
1..1
not ok 1 - test should not crash
# function 93() abort dict Line:3 (/private/var/folders/xb/352hz3xn31z9zthlfl2pc03m0000gn/T/nvimpwwRhG/1)
# function <SNR>15_eval(expr, scopes) abort Line:11 (~/.vim/bundle/vim-themis/autoload/themis/helper/command.vim)
# function <SNR>16_assert_is_none(value, ...) abort Line:1 (~/.vim/bundle/vim-themis/autoload/themis/helper/assert.vim)
# function <SNR>16_check_type(value, expected_types, not, additional_message) abort Line:24 (~/.vim/bundle/vim-themis/autoload/themis/helper/assert.vim)
#
# Vim(throw):E724: unable to correctly dump variable with self-referencing container
Can we add ftdetect/themis.vim
, ftplugin/vimspec.vim
, ... to vim runtime? Refer vim/vim#14380 It is not hard.
TIA!
Add support for writing tests in pure lua.
Might be modifying simple test library such as this https://github.com/bjornbytes/lust/ and using vim.fn.*
from lua to piggy back on vimscript version for themis would work.
Here is how most of javascript does this. They basically allows done
argument in the test and the test framework checks the argument and if it has 1 arg it considers it as async.
https://jestjs.io/docs/en/asynchronous
test('the data is peanut butter', done => {
function callback(data) {
expect(data).toBe('peanut butter');
done();
}
fetchData(callback);
});
Can we have something like this?
Async It should fetch data
call timer_start(5000, {t->Done()})
End
It does need to support default timeout and also allows us to specific custom timeouts which could be done by Async(10000) It should ...
This would make it easy to test async parts of vim-lsp.
.themisrc
に noswapfile
を指定していても themis test/test.vim
のように特定のテストファイルを指定して実行した場合にスワップファイルが生成される場合があります。これを避ける方法はないでしょうか?
Currently, themis support Vim 7.4(in CI setting)
But themis used vital, and vital now unsupport under 8.0 or below(support only prev 8.0 and curr 8.1)
I have question for updating policy.
If themis's vital updated. just cut 7.4?
# I need to update themis, and add suppoort blob type check in current vital.
VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 19 2019 12:07:42) macOS version Included patches: 1-950 Compiled by Homebrew Huge version with MacVim GUI. Features included (+) or not (-): +acl +cryptv +fork() +modify_fname +perl +tag_old_static +viminfo +arabic +cscope +fullscreen +mouse +persistent_undo -tag_any_white +vreplace +autocmd +cursorbind -gettext +mouseshape +postscript +tcl +wildignore +autochdir +cursorshape -hangul_input +mouse_dec +printer +termguicolors +wildmenu -autoservername +dialog_con_gui +iconv -mouse_gpm +profile +terminal +windows +balloon_eval +diff +insert_expand -mouse_jsbterm -python +terminfo +writebackup +balloon_eval_term +digraphs +job +mouse_netterm +python3 +termresponse -X11 +browse +dnd +jumplist +mouse_sgr +quickfix +textobjects -xfontset ++builtin_terms -ebcdic +keymap -mouse_sysmouse +reltime +textprop +xim +byte_offset +emacs_tags +lambda +mouse_urxvt +rightleft +timers -xpm +channel +eval +langmap +mouse_xterm +ruby +title -xsmp +cindent +ex_extra +libcall +multi_byte +scrollbind +toolbar -xterm_clipboard +clientserver +extra_search +linebreak +multi_lang +signs +transparency -xterm_save +clipboard -farsi +lispindent -mzscheme +smartindent +user_commands +cmdline_compl +file_in_path +listcmds +netbeans_intg +startuptime +vartabs +cmdline_hist +find_in_path +localmap +num64 +statusline +vertsplit +cmdline_info +float +lua +odbeditor -sun_workshop +virtualedit +comments +folding +menu +packages +syntax +visual +conceal -footer +mksession +path_extra +tag_binary +visualextra system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "$VIM/gvimrc" user gvimrc file: "$HOME/.gvimrc" 2nd user gvimrc file: "~/.vim/gvimrc" defaults file: "$VIMRUNTIME/defaults.vim" system menu file: "$VIMRUNTIME/menu.vim" fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim" Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_F ORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: clang -L. -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal. sdk/usr/local/libressl/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr /local/lib -L. -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/us r/local/libressl/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/local /lib -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lm -lncurses -liconv -framework AppKit -L/usr/local/opt/lua/lib -ll ua5.3 -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -L/usr/local/opt/python/Frameworks/Python.framew ork/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation -F/System/Library/Frameworks -framework Tcl -framewo rk CoreFoundation -framework Ruby
Clone vim-themis
git clone https://github.com/thinca/vim-themis.git
Save test case to file foo.vimspec
as follows:
call themis#helper('command').with(themis#helper('assert'))
Describe test
It should pass
Assert 1
End
End
And run the script as follows:
./vim-themis/bin/themis foo.vimspec
It should output
1..1
ok 1 - test should pass
# tests 1
# passes 1
But I got output
1o
##
Note: No newline after last #
I confirmed expected behavior with old Vim at /usr/bin/vim
which is pre-installed in macOS. The version is 7.4p898
(actually patches are 1-898, 985, 8056
and I don't know what 8056 is).
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul 31 2018 23:07:42) Included patches: 1-898, 985, 8056 Compiled by [email protected] Normal version without GUI. Features included (+) or not (-): +acl -farsi -mouse_netterm +syntax -arabic +file_in_path -mouse_sgr +tag_binary +autocmd +find_in_path -mouse_sysmouse +tag_old_static -balloon_eval +float -mouse_urxvt -tag_any_white -browse +folding +mouse_xterm -tcl +builtin_terms -footer +multi_byte +terminfo +byte_offset +fork() +multi_lang +termresponse +cindent -gettext -mzscheme +textobjects -clientserver -hangul_input +netbeans_intg +title -clipboard +iconv +path_extra -toolbar +cmdline_compl +insert_expand -perl +user_commands +cmdline_hist +jumplist +persistent_undo +vertsplit +cmdline_info -keymap +postscript +virtualedit +comments -langmap +printer +visual -conceal +libcall -profile +visualextra +cryptv +linebreak +python/dyn +viminfo +cscope +lispindent -python3 +vreplace +cursorbind +listcmds +quickfix +wildignore +cursorshape +localmap +reltime +wildmenu +dialog_con -lua -rightleft +windows +diff +menu +ruby/dyn +writebackup +digraphs +mksession +scrollbind -X11 -dnd +modify_fname +signs -xfontset -ebcdic +mouse +smartindent -xim -emacs_tags -mouseshape -sniff -xsmp +eval -mouse_dec +startuptime -xterm_clipboard +ex_extra -mouse_gpm +statusline -xterm_save +extra_search -mouse_jsbterm -sun_workshop -xpm system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" fall-back for $VIM: "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -liconv
THEMIS_VIM=/usr/bin/vim ./vim-themis/bin/themis foo.vimspec
So I guess this is a regression issue with grow of Vim.
I also comfirmed expected behavior with Neovim. So this issue seems to occur with recent Vim only.
filetype vim のインデントを引き継いでいるからだと思われる。
vimのインデントファイルは =~ #
じゃなくて =~
で判定をしていて、end
が入力されると逆インデントされる。
ignorecase
だとEnd
でも逆インデントが起こる。
Using a new type such as v:none
throws the following exception.
1) Argument Instance .get() Optional returns {default} when {expr} is not found
function 126() abort dict Line:1 (/private/var/folders/f_/dypbhlxd4cqg63lb40ykq0580000gn/T/vXrC8dU/1)
function <SNR>16_eval(expr, scopes) abort Line:11 (~/.vim/bundle/repos/github.com/thinca/vim-themis/autoload/themis/helper/command.vim)
function <SNR>15_assert_equals(actual, expect, ...) abort Line:1 (~/.vim/bundle/repos/github.com/thinca/vim-themis/autoload/themis/helper/assert.vim)
function <SNR>15_equals(a, b) abort Line:5 (~/.vim/bundle/repos/github.com/thinca/vim-themis/autoload/themis/helper/assert.vim)
function <SNR>15_is_comparable(a, b) abort Line:2 (~/.vim/bundle/repos/github.com/thinca/vim-themis/autoload/themis/helper/assert.vim)
function <SNR>15_type(value) abort Line:1 (~/.vim/bundle/repos/github.com/thinca/vim-themis/autoload/themis/helper/assert.vim)
Vim(return):E716: Key not present in Dictionary: 7
So how about adding new types directly like (not tested):
let s:type_names = {
\ type(0): 'number',
\ type(''): 'string',
\ type(function('type')): 'funcref',
\ type([]): 'list',
\ type({}): 'dictionary',
\ type(0.0): 'float',
\ }
" The following types might not exist on old Vim
call extend(s:type_names, {
\ 6: 'boolean',
\ 7: 'none',
\ 8: 'job',
\ 9: 'channel',
\})
I know that themis has several assert functions like assert_is_float()
so the solution above is not enough though.
cmd.exe 上で実行した場合に、特に編集作業などをしなくてもインサートモードに入ってしまうと表示が崩れてしまうようです。
次のテストスクリプトは正常に終了します
let s:suite = themis#suite('Test in cmd.exe: case1:')
let s:assert = themis#helper('assert')
function! s:suite.test() abort
call s:assert.equals(3, 1 + 2)
endfunction
しかし、次のテストでは表示が崩れてしまいます。
let s:suite = themis#suite('Test in cmd.exe: case2:')
let s:assert = themis#helper('assert')
function! s:suite.test() abort
normal! i
call s:assert.equals(3, 1 + 2)
endfunction
テスト自体は正しく実行されているようです。また、ほかの端末では観測していません (なので、cmd.exeの問題?)。何か使い方を間違えていたら教えてください。
For example, the following Vimspec succeeded
Describe Test
It quits
qa!
End
It fails
Assert Equals("hoge", "fuga")
End
End
But I believe that the above test should be failed at least.
Vimspec style tests fail in vim9 script.
Create test.vimspec
as follows:
vim9script
Describe d
Context c
It should pass
Assert Equals(3, 1 + 2)
End
End
End
Then run ./bin/themis test.vimspec
.
$ ./bin/themis test.vimspec
Bail out! Error occurred in script loading.
# function themis/Runner.load_scripts(files_with_styles, target_bundle) abort dict Line:11 [ Absolute Line: 130 ] (~/vimfiles/pack/cui/start/vim-them
is/autoload/themis/runner.vim)
# function themis/style['vimspec'].load_script(filename, runner) abort dict Line:5 [ Absolute Line: 298 ] (~/vimfiles/pack/cui/start/vim-themis/autol
oad/themis/style/vimspec.vim)
# function script() This function is already deleted.
# 1:
# Vim(vim9script):E1039: "vim9script" must be the first command in a script
On the other hand, basic style tests don't fail.
vim9script
var assert = themis#helper('assert')
def MyTest()
assert.equals(3, 1 + 2)
enddef
$ ./bin/themis test.vim
1..0
# tests 0
# passes 0
I expect vimspec style tests don't fail in vim9 script as well as basic style tests.
See above.
One of my tests is failing. The function reports possible problems using a logger that basically does echomsg
. I would like to see those log statements to troubleshoot the test, but the themis
command just reports that my function returned an empty list instead of my expected value.
It would be nice if there was an option to include the output of :messages
(with the exception of the Maintainer
line at the beginning) along with the assertion errors in the reporter output for failing tests.
This could be accomplished with something like calling messages clear
before each test, then capturing messages after the test with
let save_reg = getreg('m')
redir @m
silent messages
redir END
call setreg('m', save_reg)
Is there a way to test a script which relies on the cursor position with movements?
Thanks for the great work!
themis コマンドを実行した時に起動される Vim のパスですが、$THEMIS_VIM
を使用することになっており、
これの初期値が vim になっています。
Vim から themis コマンドを起動する場合もあることを考えると、この環境変数の初期値は $VIM
にしたほうが良いのではないかと思っています。 $VIM
が空の時、"vim" とすることで互換性を保つことができます。
いかがでしょうか。
.themisrc
全テストの前後で初期化・終了処理を行いたいという要望とデフォルトの Before, Before all, After, After all
が欲しいという要望です。
例えば IO などでテスト中は tempname()
によるディレクトリを利用して、テストが終わったら消したいなどの場合に便利です。Before
などでは インスタンス作成時 にディレクトリ構造を構築するタイプのものだと After
で削除した後に期待するサブディレクトリにアクセスできずに落ちます
Before, After
そのままですが、バッファの初期化処理などをすべてのテストに記載するのが面倒なので .themisrc
などに記載するとすべてのテストファイルに適用される、などの機能があると助かります。
Like: https://travis-ci.org/vim-jp/vital.vim/jobs/117924274#L1500
Some workaround is required while recent Vim introduce a partial function and the behaviour of string({funcref})
has changed.
I know that @thinca is working on this but in case for vim-themis users.
I'm sorry but it seems the line should be REMOVE
The test failed but themis reported it successed. https://ci.appveyor.com/project/lambdalisue/gina-vim/build/408/job/0qjhorgvu99tdamt
Because I'm now moving, I temporary lost my Windows environment so I cannot confirm. I'm really sorry for this but could you confirm if the line I pointed was the reason and fix?
Run vim script below using themis, it will be succeed.
Why?
let s:suite= themis#suite('It looks like a bug?')
let s:assert= themis#helper('assert')
function! s:suite.zero_equals_string()
call s:assert.equals(0, '')
endfunction
In the help doc says, ".vimspec" files will be converted to vim script, but how to save the converted ".vim" file?
has_key
の逆バージョンである not_has_key
的なものがあると便利です。
expect
の場合は not
があるので不要かもしれませんが assert
の場合は Assert !has_key(...)
とする必要があり統一感が崩れてしまいます。ご一考いただければ幸いです。
以下のコードを themis
経由で呼ぶか普通に :source %
で実行するかで aX
の順番が変わります。
try
let s:suite = themis#suite('timer test')
let s:assert = themis#helper('assert')
catch
let s:suite = {}
endtry
function! s:suite.test() abort
let rs = []
call timer_start(0, { -> add(rs, 'a1') })
call timer_start(0, { -> add(rs, 'a2') })
call timer_start(0, { -> add(rs, 'a3') })
call timer_start(0, { -> timer_start(0, { -> add(rs, 'b1') }) })
call timer_start(0, { -> timer_start(0, { -> add(rs, 'b2') }) })
call timer_start(0, { -> timer_start(0, { -> add(rs, 'b3') }) })
sleep 100m
call s:assert.equals(rs, ['a1', 'a2', 'a3', 'b1', 'b2', 'b3'])
endfunction
function! s:not_themis() abort
let rs = []
call timer_start(0, { -> add(rs, 'a1') })
call timer_start(0, { -> add(rs, 'a2') })
call timer_start(0, { -> add(rs, 'a3') })
call timer_start(0, { -> timer_start(0, { -> add(rs, 'b1') }) })
call timer_start(0, { -> timer_start(0, { -> add(rs, 'b2') }) })
call timer_start(0, { -> timer_start(0, { -> add(rs, 'b3') }) })
sleep 100m
call themis#log(string(rs))
endfunction
call s:not_themis()
$ themis test.vim
['a3', 'a2', 'a1', 'b1', 'b2', 'b3']
1..1
not ok 1 - timer test test
# The equivalent values were expected, but it was not the case.
#
# expected: ['a1', 'a2', 'a3', 'b1', 'b2', 'b3']
# got: ['a3', 'a2', 'a1', 'b1', 'b2', 'b3']
# tests 1
# passes 0
# fails 1
:QuickRun
['a1', 'a2', 'a3', 'b1', 'b2', 'b3']
*** time: 0.14395 ***
The error message for a failing expect
call doesn't provide a lot of context about which line is failing. For example, # Expected 2 to equal '1'
if there are several expect
calls in the test, all of which involve numbers, or perhaps when checking a property of a list of items in a loop.
I'd like to specify a message as part of the expect
chain, much as one can be provided with assert
calls. I can think of a couple ways this could be done:
s:expect(len(l:mylist), 'should have one element').to_equal(1)
s:expect(len(l:mylist)).with_message('should have one element').to_equal(1)
let s:withmsg = themis#helper('with_message')
call s:withmsg('should have one element').expect(len(l:mylist)).to_equal(1)
" could wrap assert, too
call s:withmsg('should be upper case').assert.match(l:mylist[0], '^[A-Z]\+l')
今は files.kaoriya.net のものを使っていただいていますが
https://github.com/koron/vim-kaoriya/releases/latest
のものに切り替えることは可能でしょうか?
特に事故などが無い限り、正式リリースのたびに同じものをアップロードしてます。
理由はいくつかありますが
files.kaoriya.net は自前サーバのためサービスの継続性にお約束ができないことと、
また github のほうが AppVeyor とのネットワーク的な距離が近いことが期待できるのではないかなと。
古い 7.3 については別途考える必要があるとは考えています。
「ココに置くと良いのでは」みたいな提案がありましたら、お願いします。
It would be nice if I can see which test is failed even when Fatal error occur with dot report like
FATAL ERROR:
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................PP........................................................................................................................................................................................
Error occurred in core.
Command exited with code 1
https://ci.appveyor.com/project/vim-jp/vital-vim/build/125/job/c4jxuj42toofqkq0
It is quite difficult to figure out which test or file cause the fatal error
Like Fail
, TODO
, or Skip
but won't stop test. While vim-themis hooks stdout, it would be really nice if themis provide such kind of command 😄
Consider having a test like this:
let s:suite = themis#suite('my_test')
let s:assert = themis#helper('assert')
function! s:suite.test_valid() abort
call s:assert.equals(0, 1-1)
call s:assert.equals(2, 1+1)
call s:assert.equals(3, 1+1)
call s:assert.equals(4, 2+2)
call s:assert.equals(5, 3+2)
endfunction
Output for spec
reporter is this:
my_test
[✖] test_valid
The equivalent values were expected, but it was not the case.
expected: 2
got: 3
tests 1
passes 0
fails 1
There's no information which exact assertion (on which line) failed.
Same thing with other reporters.
Something like this would be great:
my_test
[✖] test_valid
The equivalent values were expected, but it was not the case.
expected: 2
got: 3
line: 7
tests 1
passes 0
fails 1
関連: vim-jp/vital.vim@5be3f47#diff-1b378d5544b1d7b56f1f8acdf6e9878eR92
themis.vim ではおそらく -e でコマンドモードで実行されるため,statuslineのredrawなどがなされません(たぶん).
:visual とか挟んでみてもだめでした.
実際にvimのUI(?)を立ち上げてテストするオプションとかあったら嬉しいです
There has been no tag since Dec 2017. For vim-lsp we explicitly use the tag to get a specific commit for vim-themis.
v1.5.1 で通るテストが v1.5.2 で落ちるようになった (vim: 7.4.1685)
Vital.Vim.ScriptLocal
にてスクリプトローカル変数を書き換えてテストを行っているが v1.5.2 だと書き換えが適用されていない感じ(下記が一番シンプルな関連箇所です)
上記の let sv.references['foo'] = { 'worktree': 'foo' }
が適用されず、直後で call themis#log(gita#core#_get_references())
しても空辞書が表示されます( gita/core.vim
に gita#core#_get_references()
という s:references
を返す関数を追加した場合)。
必要な情報などあれば追記します ;-)
Do you think it would be possible to implement testing coverage?
Or would you know of another tool that fulfill this purpose?
Thanks for the great work!
Shougo/vimproc.vim#221 (comment)
themisの問題と言うよりは、AppVeyorあるいはCygwinやVimの問題かもしれませんが、AppVeyor上のCygwin上でthemisが動きません。
動くようになるとありがたいです。
Thank you for your great framework.
I found an unspecified behavior as follows:
let s:suite = themis#suite('test')
let s:expect = themis#helper('expect')
function! s:suite.works_fine()
call s:expect(0).to_be_false()
endfunction
function! s:suite.does_not_work()
let i = 0
let imax = 10
while i < imax
call s:expect(0).to_be_false()
let i += 1
endwhile
endfunction
Result:
% themis themis-test.vim
1..2
ok 1 - test works_fine
not ok 2 - test does_not_work
# function 102() Line:4 (~/tmp/themis-test.vim)
# Vim(call):E488: Trailing characters
# tests 2
# passes 1
# fails 1
Environment:
以下が表題の現象を再現させるための最小のテストスクリプトになります。
let s:suite= themis#suite('uryiiiii')
let s:dic= {}
function! s:dic.apply(list)
let o= {'val': 'hoge'}
function! o.test(val)
return a:val =~# self.val
endfunction
return filter(copy(a:list), 'o.test(v:val)')
endfunction
function! s:suite.test()
call s:dic.apply([{}])
endfunction
通常であれば、以下のエラーが表示されるのですが、
function 740..741, line 1
E735: Can only compare Dictionary with Dictionary
themisでのテスト時に例外が発生すると詳細が何も表示されなくなります。
1..1
------------------------------------------------------------------------------
FATAL ERROR:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.