diff options
author | w0rp <devw0rp@gmail.com> | 2018-07-15 18:24:53 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-07-15 18:28:28 +0100 |
commit | a42999a639b2916b769a85f37d037be314d9d61b (patch) | |
tree | 5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/command_callback/test_glslang_command_callback.vader | |
parent | 5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff) | |
download | ale-a42999a639b2916b769a85f37d037be314d9d61b.zip |
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/command_callback/test_glslang_command_callback.vader')
-rw-r--r-- | test/command_callback/test_glslang_command_callback.vader | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/test/command_callback/test_glslang_command_callback.vader b/test/command_callback/test_glslang_command_callback.vader index 1b1722a4..980406af 100644 --- a/test/command_callback/test_glslang_command_callback.vader +++ b/test/command_callback/test_glslang_command_callback.vader @@ -1,40 +1,19 @@ Before: - Save g:ale_glsl_glslang_executable - Save g:ale_glsl_glslang_options - - unlet! g:ale_glsl_glslang_executable - unlet! g:ale_glsl_glslang_options - - runtime ale_linters/glsl/glslang.vim - call ale#test#SetDirectory('/testplugin/test/command_callback') + call ale#assert#SetUpLinterTest('glsl', 'glslang') After: - Restore - call ale#linter#Reset() + call ale#assert#TearDownLinterTest() -Execute(Executable should default to glslangValidator): - AssertEqual - \ 'glslangValidator', - \ ale_linters#glsl#glslang#GetExecutable(bufnr('')) +Execute(The default command should be correct): + AssertLinter 'glslangValidator', ale#Escape('glslangValidator') . ' -C %t' -Execute(Executable should be configurable): - let g:ale_glsl_glslang_executable = 'foobar' - AssertEqual - \ 'foobar', - \ ale_linters#glsl#glslang#GetExecutable(bufnr('')) +Execute(The executable should be configurable): + let b:ale_glsl_glslang_executable = 'foobar' -Execute(Command should use executable): - AssertEqual - \ 'glslangValidator -C %t', - \ ale_linters#glsl#glslang#GetCommand(bufnr('')) - - let g:ale_glsl_glslang_executable = 'foobar' - AssertEqual - \ 'foobar -C %t', - \ ale_linters#glsl#glslang#GetCommand(bufnr('')) + AssertLinter 'foobar', ale#Escape('foobar') . ' -C %t' Execute(Options should work): let g:ale_glsl_glslang_options = '--test' - AssertEqual - \ 'glslangValidator --test -C %t', - \ ale_linters#glsl#glslang#GetCommand(bufnr('')) + + AssertLinter 'glslangValidator', + \ ale#Escape('glslangValidator') . ' --test -C %t' |