This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/command_callback/test_erlang_erlc_command_callback.vader
2020-10-28 12:58:15 +01:00

40 lines
1.3 KiB
Text

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 . ']'