]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_thrift.vader

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 '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / linter / test_thrift.vader
1 Before:
2   call ale#assert#SetUpLinterTest('thrift', 'thrift')
3   let b:suffix = ' -out ' . ale#Escape('TEMP_DIR') . ' %t'
4
5   function! GetCommand(buffer) abort
6     call ale#engine#InitBufferInfo(a:buffer)
7     let l:command = ale_linters#thrift#thrift#GetCommand(a:buffer)
8     call ale#engine#Cleanup(a:buffer)
9
10     let l:split_command = split(l:command)
11     let l:index = index(l:split_command, '-out')
12
13     if l:index >= 0
14       let l:split_command[l:index + 1] = 'TEMP'
15     endif
16
17     return join(l:split_command)
18   endfunction
19
20 After:
21   unlet! b:suffix
22   delfunction GetCommand
23   call ale#assert#TearDownLinterTest()
24
25 Execute(The default command should be correct):
26   AssertLinter 'thrift', ale#Escape('thrift') . ' --gen cpp -I . -strict' . b:suffix
27
28 Execute(The executable should be configurable):
29   let b:ale_thrift_thrift_executable = 'foobar'
30
31   AssertLinter 'foobar', ale#Escape('foobar') . ' --gen cpp -I . -strict' . b:suffix
32
33 Execute(The list of generators should be configurable):
34   let b:ale_thrift_thrift_generators = ['java', 'py:dynamic']
35
36   AssertLinter 'thrift', ale#Escape('thrift')
37   \ . ' --gen java --gen py:dynamic -I . -strict' . b:suffix
38
39   let b:ale_thrift_thrift_generators = []
40
41   AssertLinter 'thrift', ale#Escape('thrift') . ' --gen cpp -I . -strict' . b:suffix
42
43 Execute(The list of include paths should be configurable):
44   let b:ale_thrift_thrift_includes = ['included/path']
45
46   AssertLinter 'thrift', ale#Escape('thrift')
47   \ . ' --gen cpp -I included/path -strict' . b:suffix
48
49 Execute(The string of compiler options should be configurable):
50   let b:ale_thrift_thrift_options = '-strict --allow-64bit-consts'
51
52   AssertLinter 'thrift', ale#Escape('thrift')
53   \   . ' --gen cpp -I . -strict --allow-64bit-consts' . b:suffix