mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
Fix some escaping and make some tests set filenames consistently
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
Before:
|
||||
Save g:ale_php_phpcs_executable
|
||||
Save g:ale_php_phpcs_use_global
|
||||
|
||||
let g:ale_php_phpcs_executable = 'phpcs_test'
|
||||
let g:ale_php_phpcs_use_global = 0
|
||||
|
||||
silent! cd /testplugin/test
|
||||
let g:dir = getcwd()
|
||||
@@ -7,39 +11,32 @@ Before:
|
||||
runtime ale_linters/php/phpcs.vim
|
||||
|
||||
After:
|
||||
let g:ale_php_phpcs_executable = 'phpcs'
|
||||
let g:ale_php_phpcs_use_global = 0
|
||||
Restore
|
||||
|
||||
silent execute 'cd ' . g:dir
|
||||
silent execute 'cd ' . fnameescape(g:dir)
|
||||
unlet! g:dir
|
||||
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(project with phpcs should use local by default):
|
||||
silent noautocmd new phpcs-test-files/project-with-phpcs/vendor/bin/phpcs
|
||||
call ale#test#SetFilename('phpcs-test-files/project-with-phpcs/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ g:dir . '/phpcs-test-files/project-with-phpcs/vendor/bin/phpcs',
|
||||
\ ale_linters#php#phpcs#GetExecutable(bufnr(''))
|
||||
|
||||
:q
|
||||
|
||||
Execute(use-global should override local detection):
|
||||
let g:ale_php_phpcs_use_global = 1
|
||||
|
||||
silent noautocmd new phpcs-test-files/project-with-phpcs/vendor/bin/phpcs
|
||||
call ale#test#SetFilename('phpcs-test-files/project-with-phpcs/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ 'phpcs_test',
|
||||
\ ale_linters#php#phpcs#GetExecutable(bufnr(''))
|
||||
|
||||
:q
|
||||
|
||||
Execute(project without phpcs should use global):
|
||||
silent noautocmd new phpcs-test-files/project-without-phpcs/vendor/bin/phpcs
|
||||
call ale#test#SetFilename('phpcs-test-files/project-without-phpcs/foo/test.php')
|
||||
|
||||
AssertEqual
|
||||
\ 'phpcs_test',
|
||||
\ ale_linters#php#phpcs#GetExecutable(bufnr(''))
|
||||
|
||||
:q
|
||||
|
||||
Reference in New Issue
Block a user