diff options
author | w0rp <devw0rp@gmail.com> | 2020-08-29 16:31:47 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2020-08-29 16:31:47 +0100 |
commit | f1ecc2e06828243bb0425036ce2dc3ca36cd114f (patch) | |
tree | ee727f83feef5610d806e8e146bd8c1689e6fb36 /test | |
parent | 7e0cdb53ecf9c94bb8777a57de8bf2aacca46b5d (diff) | |
download | ale-f1ecc2e06828243bb0425036ce2dc3ca36cd114f.zip |
Fix psalm options. Retry on some test failures
Diffstat (limited to 'test')
-rw-r--r-- | test/command_callback/test_psalm_command_callbacks.vader | 31 | ||||
-rw-r--r-- | test/completion/test_completion_events.vader | 2 |
2 files changed, 26 insertions, 7 deletions
diff --git a/test/command_callback/test_psalm_command_callbacks.vader b/test/command_callback/test_psalm_command_callbacks.vader index 70b5af95..29698789 100644 --- a/test/command_callback/test_psalm_command_callbacks.vader +++ b/test/command_callback/test_psalm_command_callbacks.vader @@ -2,6 +2,9 @@ Before: call ale#assert#SetUpLinterTest('php', 'psalm') After: + unlet! g:i + unlet! g:matched + if isdirectory(g:dir . '/.git') call delete(g:dir . '/.git', 'd') endif @@ -22,19 +25,35 @@ Execute(Vendor executables should be detected): \ . '/psalm-project/vendor/bin/psalm' \ )) . ' --language-server' + 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_psalm_langserver_options = '--my-user-provided-option my-value' + 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' - Execute(The project path should be correct for .git directories): call ale#test#SetFilename('psalm-project/test.php') - if !isdirectory(g:dir . '/.git') - call mkdir(g:dir . '/.git') - endif + for g:i in range(4) + if !isdirectory(g:dir . '/.git') + call mkdir(g:dir . '/.git') + endif + + try + AssertLSPProject g:dir + catch /.+/ + endtry - AssertLSPProject g:dir + let g:matched = 1 + break + endfor + + if !g:matched + AssertLSPProject g:dir + endif diff --git a/test/completion/test_completion_events.vader b/test/completion/test_completion_events.vader index 3a7a31d0..87bd10ad 100644 --- a/test/completion/test_completion_events.vader +++ b/test/completion/test_completion_events.vader @@ -35,7 +35,7 @@ Before: let g:ale_completion_delay = 0 " Run this check a few times, as it can fail randomly. - for g:i in range(has('nvim-0.3') || has('win32') ? 5 : 1) + for l:i in range(has('nvim-0.3') || has('win32') ? 5 : 1) call ale#completion#Queue() sleep 1m |