This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/command_callback/test_psalm_command_callbacks.vader

61 lines
1.4 KiB
Text
Raw Normal View History

2018-09-27 15:48:47 +00:00
Before:
call ale#assert#SetUpLinterTest('php', 'psalm')
After:
unlet! g:i
unlet! g:matched
2018-10-19 20:31:12 +00:00
if isdirectory(g:dir . '/.git')
call delete(g:dir . '/.git', 'd')
endif
2018-09-27 15:48:47 +00:00
call ale#assert#TearDownLinterTest()
2018-10-19 20:31:12 +00:00
Execute(The default executable path should be correct):
AssertLinter 'psalm',
\ ale#Escape('psalm') . ' --language-server'
2018-10-19 20:31:12 +00:00
Execute(Vendor executables should be detected):
call ale#test#SetFilename('psalm-project/test.php')
AssertLinter
\ ale#path#Simplify(g:dir . '/psalm-project/vendor/bin/psalm'),
2018-10-19 20:31:12 +00:00
\ ale#Escape(ale#path#Simplify(
\ g:dir
\ . '/psalm-project/vendor/bin/psalm'
\ )) . ' --language-server'
2018-09-27 15:48:47 +00:00
let g:ale_php_psalm_use_global = 1
AssertLinter 'psalm',
\ ale#Escape('psalm') . ' --language-server'
Execute(User provided options should be used):
let g:ale_php_psalm_options = '--my-user-provided-option my-value'
AssertLinter 'psalm',
\ ale#Escape('psalm')
\ . ' --language-server --my-user-provided-option my-value'
2018-10-19 20:31:12 +00:00
Execute(The project path should be correct for .git directories):
call ale#test#SetFilename('psalm-project/test.php')
2020-08-29 15:32:17 +00:00
let g:matched = 0
2018-09-27 15:48:47 +00:00
for g:i in range(4)
if !isdirectory(g:dir . '/.git')
call mkdir(g:dir . '/.git')
endif
try
AssertLSPProject g:dir
catch /.+/
endtry
2019-03-29 16:09:27 +00:00
let g:matched = 1
break
endfor
if !g:matched
AssertLSPProject g:dir
endif