mirror of
https://github.com/dense-analysis/ale
synced 2024-12-22 06:10:07 +00:00
c6a5cbb3c7
Use ant files to load Java settings too.
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
Before:
|
|
call ale#test#SetDirectory('/testplugin/test')
|
|
runtime ale_linters/java/javac.vim
|
|
|
|
After:
|
|
call ale#test#RestoreDirectory()
|
|
call ale#linter#Reset()
|
|
|
|
Execute(Should return current directory if called on the project root):
|
|
call ale#test#SetFilename('ant-test-files/ant-project/Main.java')
|
|
|
|
AssertEqual
|
|
\ ale#path#Simplify(g:dir . '/ant-test-files/ant-project'),
|
|
\ ale#ant#FindProjectRoot(bufnr(''))
|
|
|
|
Execute(Should return root directory if called on a deeply nested source file):
|
|
call ale#test#SetFilename('ant-test-files/ant-project/src/several/namespace/layers/A.java')
|
|
|
|
AssertEqual
|
|
\ ale#path#Simplify(g:dir . '/ant-test-files/ant-project'),
|
|
\ ale#ant#FindProjectRoot(bufnr(''))
|
|
|
|
Execute(Should return empty string if called on a non-ant project):
|
|
call ale#test#SetFilename('ant-test-files/non-ant-project/Main.java')
|
|
|
|
AssertEqual
|
|
\ '',
|
|
\ ale#ant#FindProjectRoot(bufnr(''))
|
|
|
|
Execute(Should return empty string if called on a file in a non-ant project):
|
|
call ale#test#SetFilename('ant-test-files/non-ant-project/several/namespace/layers/A.java')
|
|
|
|
AssertEqual
|
|
\ '',
|
|
\ ale#ant#FindProjectRoot(bufnr(''))
|