install.fairie/dotfiles/.vim/plugged/ale/test/test_maven_find_executable.vader
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

46 lines
1.3 KiB
Text

Before:
Save $PATH
Save $PATHEXT
" Count the maven executable without .exe as executable on Windows
let $PATHEXT = '.'
call ale#test#SetDirectory('/testplugin/test')
runtime ale_linters/java/javac.vim
let g:expected_wrapper = ''
if has('unix')
let g:expected_wrapper = 'mvnw'
else
let g:expected_wrapper = 'mvnw.cmd'
endif
After:
Restore
unlet! g:expected_wrapper
call ale#test#RestoreDirectory()
call ale#linter#Reset()
Execute(Should return 'mvnw' if found in parent directory):
call ale#test#SetFilename('test-files/maven/maven-java-project/module1/src/main/java/dummy1.java')
AssertEqual
\ ale#path#Simplify(g:dir . '/test-files/maven/maven-java-project/module1/' . g:expected_wrapper),
\ ale#maven#FindExecutable(bufnr(''))
Execute(Should return 'mvn' if 'mvnw' not found in parent directory):
call ale#test#SetFilename('test-files/maven/maven-java-project/module2/src/main/java/dummy2.java')
let $PATH .= (has('win32') ? ';' : ':')
\ . ale#path#Simplify(g:dir . '/test-files/maven')
AssertEqual
\ 'mvn',
\ ale#maven#FindExecutable(bufnr(''))
Execute(Should return empty string if 'mvnw' not in parent directory and mvn not in path):
call ale#test#SetFilename('mvn-test-files/java-maven-project/module2/src/main/java/dummy2.java')
AssertEqual
\ '',
\ ale#gradle#FindExecutable(bufnr(''))