2017-08-02 22:21:30 +00:00
|
|
|
Before:
|
|
|
|
Save g:ale_rust_rls_executable
|
2017-11-26 18:47:30 +00:00
|
|
|
Save g:ale_rust_rls_toolchain
|
2017-08-02 22:21:30 +00:00
|
|
|
|
|
|
|
unlet! g:ale_rust_rls_executable
|
2017-11-26 18:47:30 +00:00
|
|
|
unlet! g:ale_rust_rls_toolchain
|
2017-08-02 22:21:30 +00:00
|
|
|
|
|
|
|
runtime ale_linters/rust/rls.vim
|
|
|
|
|
|
|
|
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(The default executable path should be correct):
|
|
|
|
AssertEqual 'rls', ale_linters#rust#rls#GetExecutable(bufnr(''))
|
|
|
|
AssertEqual
|
2017-11-26 18:47:30 +00:00
|
|
|
\ ale#Escape('rls') . ' +' . ale#Escape('nightly'),
|
|
|
|
\ ale_linters#rust#rls#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The toolchain should be configurable):
|
|
|
|
let g:ale_rust_rls_toolchain = 'stable'
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ ale#Escape('rls') . ' +' . ale#Escape('stable'),
|
2017-08-02 22:21:30 +00:00
|
|
|
\ ale_linters#rust#rls#GetCommand(bufnr(''))
|
|
|
|
|
2018-04-12 18:42:38 +00:00
|
|
|
Execute(The toolchain should be ommitted if not given):
|
|
|
|
let g:ale_rust_rls_toolchain = ''
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ ale#Escape('rls'),
|
|
|
|
\ ale_linters#rust#rls#GetCommand(bufnr(''))
|
|
|
|
|
2017-08-02 22:21:30 +00:00
|
|
|
Execute(The language string should be correct):
|
|
|
|
AssertEqual 'rust', ale_linters#rust#rls#GetLanguage(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The project root should be detected correctly):
|
|
|
|
AssertEqual '', ale_linters#rust#rls#GetProjectRoot(bufnr(''))
|
|
|
|
|
|
|
|
call ale#test#SetFilename('rust-rls-project/test.rs')
|
|
|
|
|
|
|
|
AssertEqual
|
2017-12-19 18:23:09 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/rust-rls-project'),
|
2017-08-02 22:21:30 +00:00
|
|
|
\ ale_linters#rust#rls#GetProjectRoot(bufnr(''))
|