summaryrefslogtreecommitdiff
path: root/test/command_callback/test_cpp_cquery_command_callbacks.vader
blob: 89a3e225f94463a6fa5d0bf86cd7f804449ad99b (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
41
42
43
44
45
46
47
48
" Author: Ben Falconer <ben@falconers.me.uk>
" Description: A language server for C++

Before:
  Save g:ale_cpp_cquery_executable
  Save g:ale_cpp_cquery_cache_directory

  unlet! g:ale_cpp_cquery_executable
  unlet! b:ale_cpp_cquery_executable
  unlet! g:ale_cpp_cquery_cache_directory
  unlet! b:ale_cpp_cquery_cache_directory

  runtime ale_linters/cpp/cquery.vim

After:
  Restore
  unlet! b:ale_cpp_cquery_executable
  unlet! b:ale_cpp_cquery_cache_directory
  call ale#linter#Reset()

Execute(The executable should be configurable):
  AssertEqual 'cquery', ale_linters#cpp#cquery#GetExecutable(bufnr(''))

  let b:ale_cpp_cquery_executable = 'foobar'

  AssertEqual 'foobar', ale_linters#cpp#cquery#GetExecutable(bufnr(''))

Execute(The executable should be used in the command):
  AssertEqual
  \ ale#Escape('cquery'),
  \ ale_linters#cpp#cquery#GetCommand(bufnr(''))

  let b:ale_cpp_cquery_executable = 'foobar'

  AssertEqual
  \ ale#Escape('foobar'),
  \ ale_linters#cpp#cquery#GetCommand(bufnr(''))

Execute(The cache directory should be configurable):
  AssertEqual
  \ {'cacheDirectory': expand('$HOME/.cache/cquery')},
  \ ale_linters#cpp#cquery#GetInitializationOptions(bufnr(''))

  let b:ale_cpp_cquery_cache_directory = '/foo/bar'

  AssertEqual
  \ {'cacheDirectory': '/foo/bar'},
  \ ale_linters#cpp#cquery#GetInitializationOptions(bufnr(''))