summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-06-27 21:39:36 +0100
committerGitHub <noreply@github.com>2018-06-27 21:39:36 +0100
commit980aa35566f1a5c66c7b9939bb07ec68deebccb2 (patch)
tree0639cd27bfd5a562de4a69e4e06b415be846ac63 /test/command_callback
parentb047271051d8ef448bf4bac120234205310b232a (diff)
parent4d935ff32a1ac8618c8afbf3104cf1864f633300 (diff)
downloadale-980aa35566f1a5c66c7b9939bb07ec68deebccb2.zip
Merge pull request #1675 from nicopauss/master
Improve pyrex cython linter.
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_pyrex_cython_command_callback.vader50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/command_callback/test_pyrex_cython_command_callback.vader b/test/command_callback/test_pyrex_cython_command_callback.vader
new file mode 100644
index 00000000..527ed2dd
--- /dev/null
+++ b/test/command_callback/test_pyrex_cython_command_callback.vader
@@ -0,0 +1,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(''))