summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorpinicarus <pinicarus@protonmail.com>2020-10-28 11:48:57 +0100
committerpinicarus <pinicarus@protonmail.com>2020-10-28 12:38:28 +0100
commit15f44933c2a7e2917b37e666dec4fe53a342bc11 (patch)
tree1bf58e686821fbb503602939df6aa85e334670e4 /test/command_callback
parent557a1ed5da70cb443a8650766f4e8ea95e8c0da3 (diff)
downloadale-15f44933c2a7e2917b37e666dec4fe53a342bc11.zip
feat(erlang/erlc): add option for custom 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..e101bb43
--- /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''\s\+-o\s\+[^\s]\+\s\+%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''\s\+-o\s\+[^\s]\+\s\+%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''\s\+-o\s\+[^\s]\+\s\+-I include\s\+%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 . ']'