summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorpinicarus <pinicarus@protonmail.com>2020-11-01 11:45:36 +0100
committerpinicarus <pinicarus@protonmail.com>2020-11-01 11:45:36 +0100
commitdb96b007209f7ea0983c58cb1d18771f5a45a543 (patch)
tree092fb643e078359c8e8356c41fc7cb50ceb355e7 /test/command_callback
parentd7557ef9be6ce680e811e31e217db5624d9e2897 (diff)
parent62f2c6d3261af41ef01db6868724881fd6eebccc (diff)
downloadale-db96b007209f7ea0983c58cb1d18771f5a45a543.zip
Merge branch 'custom-erlc-executable'
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_erlang_erlc_command_callback.vader40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/command_callback/test_erlang_erlc_command_callback.vader b/test/command_callback/test_erlang_erlc_command_callback.vader
new file mode 100644
index 00000000..7d659a07
--- /dev/null
+++ b/test/command_callback/test_erlang_erlc_command_callback.vader
@@ -0,0 +1,40 @@
+Before:
+ call ale#assert#SetUpLinterTest('erlang', 'erlc')
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(The default command should be correct.):
+ let g:cmd = ale_linters#erlang#erlc#GetCommand(bufnr(''))
+ let g:regex = 'erlc.\+-o.\+%t'
+ let g:matched = match(g:cmd, g:regex)
+
+ " match returns -1 if not found
+ AssertNotEqual
+ \ g:matched,
+ \ -1,
+ \ 'Command error: expected [' . g:cmd . '] to match [' . g:regex . ']'
+
+Execute(The command should accept configured executable.):
+ let b:ale_erlang_erlc_executable = '/usr/bin/erlc'
+ let g:cmd = ale_linters#erlang#erlc#GetCommand(bufnr(''))
+ let g:regex = '/usr/bin/erlc.\+-o.\+%t'
+ let g:matched = match(g:cmd, g:regex)
+
+ " match returns -1 if not found
+ AssertNotEqual
+ \ g:matched,
+ \ -1,
+ \ 'Command error: expected [' . g:cmd . '] to match [' . g:regex . ']'
+
+Execute(The command should accept configured options.):
+ let b:ale_erlang_erlc_options = '-I include'
+ let g:cmd = ale_linters#erlang#erlc#GetCommand(bufnr(''))
+ let g:regex = 'erlc.\+-o.\+-I include.\+%t'
+ let g:matched = match(g:cmd, g:regex)
+
+ " match returns -1 if not found
+ AssertNotEqual
+ \ g:matched,
+ \ -1,
+ \ 'Command error: expected [' . g:cmd . '] to match [' . g:regex . ']'