mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 13:34:46 +08:00
feat(erlang/erlc): add option for custom executable
This commit is contained in:
@@ -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 . ']'
|
||||
Reference in New Issue
Block a user