summaryrefslogtreecommitdiff
path: root/test/command_callback/test_reason_ols_callbacks.vader
blob: 53ef7fabaedaa283a0732a4d8475f98c463125d3 (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
Before:
  call ale#assert#SetUpLinterTest('reason', 'ols')

  Save &filetype
  let &filetype = 'reason'

After:
  call ale#assert#TearDownLinterTest()

Execute(The language string should be correct):
  AssertLSPLanguage 'reason'

Execute(The default executable should be correct):
  AssertLinter 'ocaml-language-server',
  \ ale#Escape('ocaml-language-server') . ' --stdio'

Execute(The project root should be detected correctly):
  AssertLSPProject ''

  call ale#test#SetFilename('ols_paths/file.re')

  AssertLSPProject ale#path#Simplify(g:dir . '/ols_paths')

Execute(The local executable should be used when available):
  call ale#test#SetFilename('ols_paths/file.re')

  AssertLinter
  \ ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'),
  \ ale#Escape(ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server')) . ' --stdio'

Execute(The gloabl executable should always be used when use_global is set):
  let g:ale_reason_ols_use_global = 1
  call ale#test#SetFilename('ols_paths/file.re')

  AssertLinter 'ocaml-language-server',
  \ ale#Escape('ocaml-language-server') . ' --stdio'

Execute(The executable should be configurable):
  let g:ale_reason_ols_executable = 'foobar'

  AssertLinter 'foobar', ale#Escape('foobar') . ' --stdio'