File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ scriptencoding utf-8
2+
3+ let s:V = vital#vital#new()
4+ let s:Path = s:V.import('System.Filepath')
5+ let s:scriptfile = s:Path.realpath(
6+ \ 'autoload/vital/__vital__/System/AsyncProcess.vim'
7+ \)
8+
9+ Describe System.AsyncProcess
10+ Before
11+ let AsyncProcess = s:V.import('System.AsyncProcess')
12+ End
13+
14+ After
15+ End
16+
17+ Describe .execute({args}, {options})
18+ It uses a String item
19+ let exit_code = ""
20+ let out_msg = ""
21+ let err_msg = ""
22+ function! s:my_out_cb(out_msg) abort
23+ let out_msg = out_msg . a:out_msg
24+ endfunction
25+ function! s:my_err_cb(err_msg) abort
26+ let err_msg = err_msg . a:err_msg
27+ endfunction
28+ function! s:my_exit_cb(exit_code) abort
29+ let exit_code = a:exit_code
30+ Assert Equals(l:exit_code, 0)
31+ Assert Equals(l:out_msg, "abcdefg\n")
32+ Assert Equals(l:err_msg, "")
33+ endfunction
34+
35+ let args = 'echo "abcdefg"'
36+ call AsyncProcess.execute(args, {
37+ \ 'exit_cb': function('s:my_exit_cb'),
38+ \ 'out_cb': function('s:my_out_cb'),
39+ \ 'err_cb': function('s:my_err_cb'),
40+ \ })
41+ End
42+ End
43+ End
You can’t perform that action at this time.
0 commit comments