summaryrefslogtreecommitdiff
path: root/test/test_format_temporary_file_creation.vader
blob: 0639c593635b7e1b8f5df4cb9d8db91a2a591afa (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
Before:
  let g:output = []

  function! TestCallback(buffer, output)
    let g:output = a:output

    return []
  endfunction

  call ale#linter#Define('foobar', {
  \ 'name': 'testlinter',
  \ 'callback': 'TestCallback',
  \ 'executable': 'cat',
  \ 'command': 'cat %t',
  \})

After:
  unlet! g:output
  delfunction TestCallback
  call ale#linter#Reset()

Given foobar (Some imaginary filetype):
  foo
  bar
  baz

Execute(ALE should be able to read the %t file):
  AssertEqual 'foobar', &filetype

  " Sleep a little so the test passes more.
  sleep 100ms
  call ale#Lint()
  call ale#engine#WaitForJobs(2000)

  AssertEqual ['foo', 'bar', 'baz'], g:output