blob: 5ce8a313b88a562051fdadade1631ed312079222 (
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
46
47
|
Before:
runtime ale_linters/sml/sml.vim
runtime ale_linters/sml/smlnj.vim
call ale#test#SetDirectory('/testplugin/test')
After:
call ale#test#RestoreDirectory()
call ale#linter#Reset()
# ----- GetCmFile -----
Execute(smlnj finds CM file if it exists):
call ale#test#SetFilename('smlnj/cm/foo.sml')
AssertEqual '/testplugin/test/smlnj/cm/sources.cm', ale#handlers#sml#GetCmFile(bufnr('%'))
Execute(smlnj finds CM file by searching upwards):
call ale#test#SetFilename('smlnj/cm/path/to/bar.sml')
AssertEqual '/testplugin/test/smlnj/cm/sources.cm', ale#handlers#sml#GetCmFile(bufnr('%'))
Execute(smlnj returns '' when no CM file found):
call ale#test#SetFilename('smlnj/file/qux.sml')
AssertEqual '', ale#handlers#sml#GetCmFile(bufnr('%'))
# ----- GetExecutableSmlnjCm & GetExecutableSmlnjFile -----
Execute(CM-project mode enabled when CM file found):
call ale#test#SetFilename('smlnj/cm/foo.sml')
AssertEqual 'sml', ale#handlers#sml#GetExecutableSmlnjCm(bufnr('%'))
Execute(single-file mode disabled when CM file found):
call ale#test#SetFilename('smlnj/cm/foo.sml')
AssertEqual '', ale#handlers#sml#GetExecutableSmlnjFile(bufnr('%'))
Execute(CM-project mode disabled when CM file not found):
call ale#test#SetFilename('smlnj/file/qux.sml')
AssertEqual '', ale#handlers#sml#GetExecutableSmlnjCm(bufnr('%'))
Execute(single-file mode enabled when CM file found):
call ale#test#SetFilename('smlnj/file/qux.sml')
AssertEqual 'sml', ale#handlers#sml#GetExecutableSmlnjFile(bufnr('%'))
|