2017-07-10 22:03:36 +00:00
|
|
|
Before:
|
2017-10-23 00:26:31 +00:00
|
|
|
Save $PATH
|
|
|
|
Save $PATHEXT
|
|
|
|
|
|
|
|
" Count the gradle executable without .exe as executable on Windows
|
|
|
|
let $PATHEXT = '.'
|
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
|
|
|
runtime ale_linters/kotlin/kotlinc.vim
|
|
|
|
|
|
|
|
After:
|
2017-10-23 00:26:31 +00:00
|
|
|
Restore
|
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
call ale#linter#Reset()
|
2017-10-23 00:26:31 +00:00
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
Execute(Should return 'gradlew' if found in parent directory):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/gradle/wrapped-project/src/main/kotlin/dummy.kt')
|
2017-07-10 22:03:36 +00:00
|
|
|
|
|
|
|
AssertEqual
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/test-files/gradle/wrapped-project/gradlew'),
|
2017-07-10 22:03:36 +00:00
|
|
|
\ ale#gradle#FindExecutable(bufnr(''))
|
|
|
|
|
|
|
|
Execute(Should return 'gradle' if 'gradlew' not found in parent directory):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/gradle/unwrapped-project/src/main/kotlin/dummy.kt')
|
|
|
|
let $PATH .= (has('win32') ? ';': ':') . ale#path#Simplify(g:dir . '/test-files/gradle')
|
2017-10-23 00:26:31 +00:00
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
AssertEqual
|
2017-10-23 00:26:31 +00:00
|
|
|
\ 'gradle',
|
2017-07-10 22:03:36 +00:00
|
|
|
\ ale#gradle#FindExecutable(bufnr(''))
|
|
|
|
|
|
|
|
Execute(Should return empty string if 'gradlew' not in parent directory and gradle not in path):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/gradle/unwrapped-project/src/main/kotlin/dummy.kt')
|
2017-10-23 00:26:31 +00:00
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
AssertEqual
|
2017-10-23 00:26:31 +00:00
|
|
|
\ '',
|
2017-07-10 22:03:36 +00:00
|
|
|
\ ale#gradle#FindExecutable(bufnr(''))
|