summaryrefslogtreecommitdiff
path: root/test/command_callback/test_dartanalyzer_command_callback.vader
blob: c7b51396bb7ea8e1810b4eb8fe0555738c5c691d (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:
  Save g:ale_dart_dartanalyzer_executable
  unlet! g:ale_dart_dartanalyzer_executable

  runtime ale_linters/dart/dartanalyzer.vim

  call ale#test#SetDirectory('/testplugin/test/command_callback')

After:
  Restore

  call ale#test#RestoreDirectory()
  call ale#linter#Reset()

Execute(The default command and executable should be correct):
  AssertEqual
  \ 'dartanalyzer',
  \ ale_linters#dart#dartanalyzer#GetExecutable(bufnr(''))
  AssertEqual
  \ ale#Escape('dartanalyzer') . ' %s',
  \ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))

Execute(The executable should be configurable):
  let g:ale_dart_dartanalyzer_executable = '/usr/lib/dart/bin/dartanalyzer'

  AssertEqual
  \ '/usr/lib/dart/bin/dartanalyzer',
  \ ale_linters#dart#dartanalyzer#GetExecutable(bufnr(''))
  AssertEqual
  \ ale#Escape('/usr/lib/dart/bin/dartanalyzer') . ' %s',
  \ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))

Execute(The .packages file should be set if detected):
  call ale#test#SetFilename('dart_paths/foo')

  AssertEqual
  \ ale#Escape('dartanalyzer')
  \   . ' --packages ' . ale#Escape(ale#path#Simplify(g:dir . '/dart_paths/.packages'))
  \   . ' %s',
  \ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))