All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#assert#SetUpLinterTest('erlang', 'erlc')
5 call ale#assert#TearDownLinterTest()
7 Execute(The default command should be correct.):
8 let g:cmd = ale_linters#erlang#erlc#GetCommand(bufnr(''))
9 let g:regex = 'erlc.\+-o.\+%t'
10 let g:matched = match(g:cmd, g:regex)
12 " match returns -1 if not found
16 \ 'Command error: expected [' . g:cmd . '] to match [' . g:regex . ']'
18 Execute(The command should accept configured executable.):
19 let b:ale_erlang_erlc_executable = '/usr/bin/erlc'
20 let g:cmd = ale_linters#erlang#erlc#GetCommand(bufnr(''))
21 let g:regex = '/usr/bin/erlc.\+-o.\+%t'
22 let g:matched = match(g:cmd, g:regex)
24 " match returns -1 if not found
28 \ 'Command error: expected [' . g:cmd . '] to match [' . g:regex . ']'
30 Execute(The command should accept configured options.):
31 let b:ale_erlang_erlc_options = '-I include'
32 let g:cmd = ale_linters#erlang#erlc#GetCommand(bufnr(''))
33 let g:regex = 'erlc.\+-o.\+-I include.\+%t'
34 let g:matched = match(g:cmd, g:regex)
36 " match returns -1 if not found
40 \ 'Command error: expected [' . g:cmd . '] to match [' . g:regex . ']'
42 Execute(Linter should recognize OTP23 format.):
43 let g:lines = ["t.erl:6: only association operators '=>' are allowed in map construction"]
44 let g:output_text = ale_linters#erlang#erlc#Handle(bufnr(''), g:lines)[0].text
46 let g:expected = "only association operators '=>' are allowed in map construction"
50 \ 'Command error: expected [' . g:output_text . '] to match [' . g:expected . ']'
52 Execute(Linter should recognize OTP24 format.):
53 let g:lines = ["t.erl:6:16: only association operators '=>' are allowed in map construction",
54 \ "% 6| #{ a => A, b := B }.",
56 let g:output_text = ale_linters#erlang#erlc#Handle(bufnr(''), g:lines)[0].text
58 let g:expected = "only association operators '=>' are allowed in map construction"
62 \ 'Command error: expected [' . g:output_text . '] to match [' . g:expected . ']'