This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/command_callback/test_pyrex_cython_command_callback.vader
Nicolas Pauss 4d935ff32a Add test_pyrex_cython_command_callback.vader
Add common callback tests to check if executable and options are well
configurable.
2018-06-25 22:14:43 +02:00

50 lines
1.5 KiB
Text

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(''))