summaryrefslogtreecommitdiff
path: root/test/command_callback/test_glslls_command_callback.vader
blob: e64c2352bf36ab6557492ec67e431488889659c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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')

After:
  Restore
  call ale#linter#Reset()

Execute(Executable should default to 'glslls'):
  AssertEqual
  \ 'glslls',
  \ ale_linters#glsl#glslls#GetExecutable(bufnr(''))

Execute(Executable should be configurable):
  let g:ale_glsl_glslls_executable = 'foobar'
  AssertEqual
  \ 'foobar',
  \ ale_linters#glsl#glslls#GetExecutable(bufnr(''))

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'

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'