summaryrefslogtreecommitdiff
path: root/test/test_deferred_executable_string.vader
blob: ad2e752bf4b0fbcf005a24ea64a9407cd06f9b85 (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
Before:
  Save g:ale_run_synchronously
  Save g:ale_buffer_info

  let g:ale_run_synchronously = 1
  let g:ale_buffer_info = {}

  call ale#linter#Reset()
  call ale#assert#SetUpLinterTestCommands()
  call ale#linter#Define('foobar', {
  \ 'name': 'lint_file_linter',
  \ 'callback': 'LintFileCallback',
  \ 'executable': {b -> ale#command#Run(b, 'echo', {-> ale#command#Run(b, 'echo', {-> 'foo'})})},
  \ 'command': 'echo',
  \ 'read_buffer': 0,
  \})

After:
  Restore

  call ale#assert#TearDownLinterTest()

Given foobar (Some imaginary filetype):
Execute(It should be possible to compute an executable to check based on the result of commands):
  let b:ale_history = []

  AssertLinter 'foo', 'echo'

  ALELint
  call ale#test#FlushJobs()

  AssertEqual
  \ [{'status': 0, 'job_id': 'executable', 'command': 'foo'}],
  \ filter(copy(b:ale_history), 'v:val.job_id is# ''executable''')