summaryrefslogtreecommitdiff
path: root/test/command_callback/test_mercury_mmc_command_callback.vader
diff options
context:
space:
mode:
authorStewy Slocum <sslocum3@jhu.edu>2018-03-25 13:33:24 -0400
committerStewy Slocum <sslocum3@jhu.edu>2018-03-25 13:33:24 -0400
commit84952918cc48a2de2082c9988e720412f146d3cc (patch)
treef5460e63b9cfe885dc95eac060ef4eeb7cbe1e0a /test/command_callback/test_mercury_mmc_command_callback.vader
parent92e6e4d1ba482a4d2d89d850f660c67ccf8a28eb (diff)
downloadale-84952918cc48a2de2082c9988e720412f146d3cc.zip
add support for mercury language using mmc as linter
Diffstat (limited to 'test/command_callback/test_mercury_mmc_command_callback.vader')
-rw-r--r--test/command_callback/test_mercury_mmc_command_callback.vader42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/command_callback/test_mercury_mmc_command_callback.vader b/test/command_callback/test_mercury_mmc_command_callback.vader
new file mode 100644
index 00000000..7ebf49c3
--- /dev/null
+++ b/test/command_callback/test_mercury_mmc_command_callback.vader
@@ -0,0 +1,42 @@
+Before:
+ Save g:ale_mercury_mmc_executable
+ Save g:ale_mercury_mmc_options
+
+ unlet! g:ale_mercury_mmc_executable
+ unlet! b:ale_mercury_mmc_executable
+ unlet! g:ale_mercury_mmc_options
+ unlet! b:ale_mercury_mmc_options
+
+ runtime ale_linters/mercury/mmc.vim
+ call ale#test#SetDirectory('/testplugin/test/command_callback')
+
+After:
+ unlet! b:ale_mercury_mmc_executable
+ unlet! b:ale_mercury_mmc_options
+
+ Restore
+ call ale#test#RestoreDirectory()
+ call ale#linter#Reset()
+
+Execute(The default command should be correct):
+ AssertEqual
+ \ ale#path#BufferCdString(bufnr(''))
+ \ . 'mmc --errorcheck-only --make --output-compile-error-lines 100 dummy',
+ \
+ \ ale_linters#mercury#mmc#GetCommand(bufnr(''))
+
+Execute(The executable should be configurable):
+ let b:ale_mercury_mmc_executable = 'foo'
+ AssertEqual
+ \ ale#path#BufferCdString(bufnr(''))
+ \ . 'foo --errorcheck-only --make --output-compile-error-lines 100 dummy',
+ \
+ \ ale_linters#mercury#mmc#GetCommand(bufnr(''))
+
+Execute(The options should be configurable):
+ let b:ale_mercury_mmc_options = '--bar'
+ AssertEqual
+ \ ale#path#BufferCdString(bufnr(''))
+ \ . 'mmc --errorcheck-only --bar dummy',
+ \
+ \ ale_linters#mercury#mmc#GetCommand(bufnr(''))