install.fairie/dotfiles/.vim/plugged/ale/test/test_ant_find_project_root.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

35 lines
1.1 KiB
Text

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('test-files/ant/ant-project/Main.java')
AssertEqual
\ ale#path#Simplify(g:dir . '/test-files/ant/ant-project'),
\ ale#ant#FindProjectRoot(bufnr(''))
Execute(Should return root directory if called on a deeply nested source file):
call ale#test#SetFilename('test-files/ant/ant-project/src/several/namespace/layers/A.java')
AssertEqual
\ ale#path#Simplify(g:dir . '/test-files/ant/ant-project'),
\ ale#ant#FindProjectRoot(bufnr(''))
Execute(Should return empty string if called on a non-ant project):
call ale#test#SetFilename('test-files/ant/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('test-files/ant/non-ant-project/several/namespace/layers/A.java')
AssertEqual
\ '',
\ ale#ant#FindProjectRoot(bufnr(''))