mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-10 06:21:53 +08:00
Clean up tests to stop people copy and pasting the wrong examples
This commit is contained in:
@@ -9,8 +9,6 @@ After:
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The default command should be correct):
|
||||
|
||||
AssertEqual
|
||||
\ 'protoc' . ' -I ' . ale#Escape(getcwd()) . ' --lint_out=. ' . '%s',
|
||||
\ ale_linters#proto#protoc_gen_lint#GetCommand(bufnr(''))
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
Before:
|
||||
Save g:ale_python_pycodestyle_executable
|
||||
Save g:ale_python_pycodestyle_options
|
||||
Save g:ale_python_pycodestyle_use_global
|
||||
|
||||
runtime ale_linters/python/pycodestyle.vim
|
||||
Save g:ale_python_pycodestyle_executable,
|
||||
\ g:ale_python_pycodestyle_options,
|
||||
\ g:ale_python_pycodestyle_use_global
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
Restore
|
||||
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The pycodestyle command callback should return default string):
|
||||
AssertEqual ale#Escape('pycodestyle') . ' -',
|
||||
\ ale_linters#python#pycodestyle#GetCommand(bufnr(''))
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
Before:
|
||||
runtime ale_linters/yaml/swaglint.vim
|
||||
|
||||
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
let g:ale_yaml_swaglint_executable = 'swaglint'
|
||||
let g:ale_yaml_swaglint_use_global = 0
|
||||
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The yaml swaglint command callback should return the correct default string):
|
||||
AssertEqual 'swaglint',
|
||||
\ ale_linters#yaml#swaglint#GetExecutable(bufnr(''))
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
Before:
|
||||
|
||||
Save g:ale_terraform_tflint_executable
|
||||
Save g:ale_terraform_tflint_options
|
||||
|
||||
runtime ale_linters/terraform/tflint.vim
|
||||
|
||||
|
||||
After:
|
||||
Restore
|
||||
call ale#linter#Reset()
|
||||
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The default executable should be configurable):
|
||||
AssertEqual 'tflint', ale_linters#terraform#tflint#GetExecutable(bufnr(''))
|
||||
|
||||
@@ -28,6 +28,7 @@ Before:
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
delfunction GetCommand
|
||||
unlet! b:ale_thrift_thrift_executable
|
||||
unlet! b:ale_thrift_thrift_generators
|
||||
|
||||
@@ -2,10 +2,11 @@ Before:
|
||||
runtime ale_linters/xml/xmllint.vim
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
let g:ale_xml_xmllint_options = ''
|
||||
let g:ale_xml_xmllint_executable = 'xmllint'
|
||||
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The xml xmllint command callback should return the correct default string):
|
||||
AssertEqual ale#Escape('xmllint') . ' --noout -',
|
||||
\ join(split(ale_linters#xml#xmllint#GetCommand(1)))
|
||||
@@ -22,4 +23,3 @@ Execute(The xmllint executable should be configurable):
|
||||
AssertEqual '~/.local/bin/xmllint', ale_linters#xml#xmllint#GetExecutable(1)
|
||||
AssertEqual ale#Escape('~/.local/bin/xmllint') . ' --noout -',
|
||||
\ join(split(ale_linters#xml#xmllint#GetCommand(1)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user