summaryrefslogtreecommitdiff
path: root/test/command_callback/test_glslls_command_callback.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-07-15 18:24:53 +0100
committerw0rp <devw0rp@gmail.com>2018-07-15 18:28:28 +0100
commita42999a639b2916b769a85f37d037be314d9d61b (patch)
tree5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/command_callback/test_glslls_command_callback.vader
parent5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff)
downloadale-a42999a639b2916b769a85f37d037be314d9d61b.zip
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/command_callback/test_glslls_command_callback.vader')
-rw-r--r--test/command_callback/test_glslls_command_callback.vader38
1 files changed, 10 insertions, 28 deletions
diff --git a/test/command_callback/test_glslls_command_callback.vader b/test/command_callback/test_glslls_command_callback.vader
index e64c2352..133c2a2f 100644
--- a/test/command_callback/test_glslls_command_callback.vader
+++ b/test/command_callback/test_glslls_command_callback.vader
@@ -1,37 +1,19 @@
Before:
- Save g:ale_glsl_glslls_executable
- Save g:ale_glsl_glslls_logfile
-
- unlet! g:ale_glsl_glslls_executable
- unlet! g:ale_glsl_glslls_logfile
-
- runtime ale_linters/glsl/glslls.vim
- call ale#test#SetDirectory('/testplugin/test/command_callback')
+ call ale#assert#SetUpLinterTest('glsl', 'glslls')
After:
- Restore
- call ale#linter#Reset()
+ call ale#assert#TearDownLinterTest()
-Execute(Executable should default to 'glslls'):
- AssertEqual
- \ 'glslls',
- \ ale_linters#glsl#glslls#GetExecutable(bufnr(''))
+Execute(The default command should be correct):
+ AssertLinter 'glslls', ale#Escape('glslls') . ' --stdin'
Execute(Executable should be configurable):
- let g:ale_glsl_glslls_executable = 'foobar'
- AssertEqual
- \ 'foobar',
- \ ale_linters#glsl#glslls#GetExecutable(bufnr(''))
+ let b:ale_glsl_glslls_executable = 'foobar'
-Execute(Command should use executable):
- let command1 = ale_linters#glsl#glslls#GetCommand(bufnr(''))
- AssertEqual command1, ale#Escape('glslls') . ' --stdin'
-
- let g:ale_glsl_glslls_executable = 'foobar'
- let command2 = ale_linters#glsl#glslls#GetCommand(bufnr(''))
- AssertEqual command2, ale#Escape('foobar') . ' --stdin'
+ AssertLinter 'foobar', ale#Escape('foobar') . ' --stdin'
Execute(Setting logfile should work):
- let g:ale_glsl_glslls_logfile = '/tmp/test.log'
- let command = ale_linters#glsl#glslls#GetCommand(bufnr(''))
- AssertEqual command, ale#Escape('glslls') . ' --verbose -l /tmp/test.log --stdin'
+ let b:ale_glsl_glslls_logfile = '/tmp/test.log'
+
+ AssertLinter 'glslls',
+ \ ale#Escape('glslls') . ' --verbose -l /tmp/test.log --stdin'