diff options
author | pinicarus <pinicarus@protonmail.com> | 2020-11-01 11:45:36 +0100 |
---|---|---|
committer | pinicarus <pinicarus@protonmail.com> | 2020-11-01 11:45:36 +0100 |
commit | db96b007209f7ea0983c58cb1d18771f5a45a543 (patch) | |
tree | 092fb643e078359c8e8356c41fc7cb50ceb355e7 /test/test_maven_find_executable.vader | |
parent | d7557ef9be6ce680e811e31e217db5624d9e2897 (diff) | |
parent | 62f2c6d3261af41ef01db6868724881fd6eebccc (diff) | |
download | ale-db96b007209f7ea0983c58cb1d18771f5a45a543.zip |
Merge branch 'custom-erlc-executable'
Diffstat (limited to 'test/test_maven_find_executable.vader')
-rw-r--r-- | test/test_maven_find_executable.vader | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/test_maven_find_executable.vader b/test/test_maven_find_executable.vader new file mode 100644 index 00000000..1d2f6da2 --- /dev/null +++ b/test/test_maven_find_executable.vader @@ -0,0 +1,46 @@ +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('maven-test-files/maven-java-project/module1/src/main/java/dummy1.java') + + AssertEqual + \ ale#path#Simplify(g:dir . '/maven-test-files/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('maven-test-files/maven-java-project/module2/src/main/java/dummy2.java') + let $PATH .= (has('win32') ? ';' : ':') + \ . ale#path#Simplify(g:dir . '/maven-test-files') + + 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('')) |