summaryrefslogtreecommitdiff
path: root/test/command_callback/test_pyrex_cython_command_callback.vader
blob: 527ed2dd54d99c35e60f6d8771edff02bb8a634d (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
38
39
40
41
42
43
44
45
46
47
48
49
50
Before:
  Save g:ale_pyrex_cython_executable
  Save g:ale_pyrex_cython_options

  unlet! g:ale_pyrex_cython_executable
  unlet! b:ale_pyrex_cython_executable
  unlet! g:ale_pyrex_cython_options
  unlet! b:ale_pyrex_cython_options

  runtime ale_linters/pyrex/cython.vim

  call ale#test#SetDirectory('/testplugin/test/command_callback')

After:
  Restore
  unlet! b:ale_pyrex_cython_options
  unlet! b:ale_pyrex_cython_executable
  call ale#linter#Reset()
  call ale#test#RestoreDirectory()

Execute(The default cython command should be correct):
  AssertEqual
  \ ale#Escape('cython')
  \   . ' --working ' . ale#Escape(g:dir)
  \   . ' --include-dir ' . ale#Escape(g:dir)
  \   . ' --warning-extra'
  \   . ' --output-file ' . g:ale#util#nul_file . ' %t',
  \ ale_linters#pyrex#cython#GetCommand(bufnr(''))

Execute(The cython executable should be configurable):
  let b:ale_pyrex_cython_executable = 'cython_foobar'

  AssertEqual
  \ ale#Escape('cython_foobar')
  \   . ' --working ' . ale#Escape(g:dir)
  \   . ' --include-dir ' . ale#Escape(g:dir)
  \   . ' --warning-extra'
  \   . ' --output-file ' . g:ale#util#nul_file . ' %t',
  \ ale_linters#pyrex#cython#GetCommand(bufnr(''))

Execute(Additional cython options should be configurable):
  let b:ale_pyrex_cython_options = '--foobar'

  AssertEqual
  \ ale#Escape('cython')
  \   . ' --working ' . ale#Escape(g:dir)
  \   . ' --include-dir ' . ale#Escape(g:dir)
  \   . ' --foobar'
  \   . ' --output-file ' . g:ale#util#nul_file . ' %t',
  \ ale_linters#pyrex#cython#GetCommand(bufnr(''))