summaryrefslogtreecommitdiff
path: root/test/command_callback/test_erlang_erlc_command_callback.vader
blob: e101bb43e3a38e5785c350344282f690729804a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 . ']'