summaryrefslogtreecommitdiff
path: root/test/linter/test_racket_langserver.vader
blob: 021eb565a71fd962ba3e08f9ce959b83fbec0763 (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
" Author: D. Ben Knoble <https://github.com/benknoble>
" Description: Tests for racket-langserver lsp linter.
Before:
  call ale#assert#SetUpLinterTest('racket', 'langserver')

After:
  call ale#assert#TearDownLinterTest()

Execute(command callback should return default string):
  AssertLinter 'racket', ale#Escape('racket').' -l racket-langserver'

Execute(should set racket-langserver for deep module 3):
  call ale#test#SetFilename('../test-files/racket/many-inits/a/b/c/foo.rkt')
  AssertLSPLanguage 'racket'
  AssertLSPOptions {}
  AssertLSPConfig {}
  AssertLSPProject ale#test#GetFilename('../test-files/racket/many-inits')

Execute(should set racket-langserver for deep module 2):
  call ale#test#SetFilename('../test-files/racket/many-inits/a/b/foo.rkt')
  AssertLSPLanguage 'racket'
  AssertLSPOptions {}
  AssertLSPConfig {}
  AssertLSPProject ale#test#GetFilename('../test-files/racket/many-inits')

Execute(should set racket-langserver for deep module 1):
  call ale#test#SetFilename('../test-files/racket/many-inits/a/foo.rkt')
  AssertLSPLanguage 'racket'
  AssertLSPOptions {}
  AssertLSPConfig {}
  AssertLSPProject ale#test#GetFilename('../test-files/racket/many-inits')

Execute(should set racket-langserver for top-level module):
  call ale#test#SetFilename('../test-files/racket/many-inits/foo.rkt')
  AssertLSPLanguage 'racket'
  AssertLSPOptions {}
  AssertLSPConfig {}
  AssertLSPProject ale#test#GetFilename('../test-files/racket/many-inits')

Execute(should set racket-langserver for non-package module or script):
  call ale#test#SetFilename('../test-files/racket/simple-script/foo.rkt')
  AssertLSPLanguage 'racket'
  AssertLSPOptions {}
  AssertLSPConfig {}
  AssertLSPProject ale#test#GetFilename('../test-files/racket/simple-script')