summaryrefslogtreecommitdiff
path: root/test/test_prepare_command.vader
blob: ebb9998d2beba3e8948fce627f972c8ff9cfccdb (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
Before:
  Save &shell
  Save &shellcmdflag

After:
  Restore
  let g:ale_has_override = {}

Execute(sh should be used when the shell is fish):
  " Set something else, so we will replace that too.
  let &shellcmdflag = '-f'
  let g:ale_has_override = {'win32': 0}

  let &shell = 'fish'

  AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand('foobar')

  let &shell = '/usr/bin/fish'

  AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand('foobar')

  let &shell = '/usr/local/bin/fish'

  AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand('foobar')

Execute(Other shells should be used when set):
  let &shell = '/bin/bash'
  let &shellcmdflag = '-c'
  let g:ale_has_override = {'win32': 0}

  AssertEqual ['/bin/bash', '-c', 'foobar'], ale#job#PrepareCommand('foobar')

Execute(cmd /c as a string should be used on Windows):
  let &shell = 'who cares'
  let &shellcmdflag = 'whatever'
  let g:ale_has_override = {'win32': 1}

  AssertEqual 'cmd /c foobar', ale#job#PrepareCommand('foobar')