]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/vim-lsp-ale/test/unit/runtime/autoload/ale/other_source.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '294584081929424aec883f90c7d6515b3743358d' as '.vim/bundle/vim-lsp-ale'
[etc/vim.git] / .vim / bundle / vim-lsp-ale / test / unit / runtime / autoload / ale / other_source.vim
1 function! ale#other_source#StartChecking(bufnr, name) abort
2     let s:start_checking_called = [a:bufnr, a:name]
3 endfunction
4
5 function! ale#other_source#ShowResults(bufnr, name, results) abort
6     let s:show_results_called = [a:bufnr, a:name, a:results]
7 endfunction
8
9 function! ale#other_source#last_start_checking() abort
10     return s:start_checking_called
11 endfunction
12
13 function! ale#other_source#last_show_results() abort
14     return s:show_results_called
15 endfunction
16
17 function! WaitUntil(func, ...) abort
18     let timeout = get(a:, 1, 1) " 1sec by default
19     let total = 0
20     while !a:func()
21         sleep 100m
22         let total += 0.1
23         if total >= timeout
24             " Note: v:true/v:false are not supported by themis.vim
25             " https://github.com/thinca/vim-themis/pull/56
26             return 0
27         endif
28     endwhile
29     return 1
30 endfunction
31
32 function! ale#other_source#wait_until_show_results() abort
33     let timeout = 1
34     let total = 0
35     while s:show_results_called is v:null
36         let total += 0.1
37         if total > timeout
38             throw 'ale#other_source#ShowResults() was not called while 1 second'
39         endif
40         sleep 100m
41     endwhile
42 endfunction
43
44 function! ale#other_source#check_show_no_result() abort
45     let timeout = 1
46     let total = 0
47     while s:show_results_called is v:null
48         let total += 0.1
49         if total > timeout
50             return
51         endif
52         sleep 100m
53     endwhile
54     throw 'ale#other_source#ShowResults() was called within 1 second: ' . string(s:show_results_called)
55 endfunction
56
57 function! ale#other_source#reset() abort
58     let s:start_checking_called = v:null
59     let s:show_results_called = v:null
60 endfunction
61
62 call ale#other_source#reset()