summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorEric Wolf <ericwolf42@gmail.com>2018-07-20 16:30:16 +0200
committererwo <erwo@abas.de>2018-07-20 16:48:27 +0200
commitac6bc6d0ae279c70081cba4225de2df54688757d (patch)
tree0d9c782d9263a2474f5fdb747d49793fc9e837ff /test/command_callback
parent61a5880747128dbf988a076e190ccb346500b5ff (diff)
downloadale-ac6bc6d0ae279c70081cba4225de2df54688757d.zip
Add cabal-ghc linter
cabal-ghc calls ghc via cabal exec and so ghc has access to packages in cabal sandboxes for example
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_haskell_cabal_ghc_command_callbacks.vader23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/command_callback/test_haskell_cabal_ghc_command_callbacks.vader b/test/command_callback/test_haskell_cabal_ghc_command_callbacks.vader
new file mode 100644
index 00000000..650aefa3
--- /dev/null
+++ b/test/command_callback/test_haskell_cabal_ghc_command_callbacks.vader
@@ -0,0 +1,23 @@
+Before:
+ Save g:ale_haskell_cabal_ghc_options
+
+ unlet! g:ale_haskell_cabal_ghc_options
+ unlet! b:ale_haskell_cabal_ghc_options
+
+ runtime ale_linters/haskell/cabal_ghc.vim
+
+After:
+ Restore
+ unlet! b:ale_haskell_cabal_ghc_options
+ call ale#linter#Reset()
+
+Execute(The options should be used in the command):
+ AssertEqual
+ \ 'cabal exec -- ghc -fno-code -v0 %t',
+ \ ale_linters#haskell#cabal_ghc#GetCommand(bufnr(''))
+
+ let b:ale_haskell_cabal_ghc_options = 'foobar'
+
+ AssertEqual
+ \ 'cabal exec -- ghc foobar %t',
+ \ ale_linters#haskell#cabal_ghc#GetCommand(bufnr(''))