Skip to content

Commit 78fa93b

Browse files
committed
Add tests for covering the coming Vint version
1 parent 62fd83f commit 78fa93b

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
Before:
22
call ale#assert#SetUpLinterTest('vim', 'vint')
3-
let b:command_tail = (has('nvim') ? ' --enable-neovim' : '')
4-
\ . ' -f "{file_path}:{line_number}:{column_number}: {severity}: {policy_name} - {description} (see {reference})" %t'
3+
let b:common_flags = (has('nvim') ? ' --enable-neovim' : '')
4+
\ . ' -f "{file_path}:{line_number}:{column_number}: {severity}: {policy_name} - {description} (see {reference})"'
55

66
After:
7-
unlet! b:bin_dir
8-
unlet! b:executable
7+
unlet! b:common_flags
8+
99
call ale#assert#TearDownLinterTest()
1010

1111
Execute(The default command should be correct):
1212
AssertLinter 'vint', [
1313
\ ale#Escape('vint') .' --version',
14-
\ ale#Escape('vint') .' -s --no-color' . b:command_tail,
14+
\ ale#Escape('vint') .' -s --no-color' . b:common_flags . ' %t',
1515
\]
1616

1717
Execute(The executable should be configurable):
1818
let g:ale_vim_vint_executable = 'foobar'
1919

2020
AssertLinter 'foobar', [
2121
\ ale#Escape('foobar') .' --version',
22-
\ ale#Escape('foobar') .' -s --no-color' . b:command_tail,
22+
\ ale#Escape('foobar') .' -s --no-color' . b:common_flags . ' %t',
2323
\]
24+
25+
Execute(The --no-color flag should not be used for older Vint versions):
26+
GivenCommandOutput ['v0.3.5']
27+
28+
AssertLinter 'vint', ale#Escape('vint') .' -s' . b:common_flags . ' %t'
29+
30+
Execute(--stdin-display-name should be used in newer versions):
31+
GivenCommandOutput ['v0.4.0']
32+
33+
AssertLinter 'vint', ale#Escape('vint') .' -s --no-color' . b:common_flags
34+
\ . ' --stdin-display-name %s -'

0 commit comments

Comments
 (0)