summaryrefslogtreecommitdiff
path: root/test/linter
diff options
context:
space:
mode:
authorHoracio Sanson <hsanson@gmail.com>2022-04-01 21:17:15 +0900
committerGitHub <noreply@github.com>2022-04-01 13:17:15 +0100
commit0f55d371e92160812ff0a57b5f48f2010a420f0c (patch)
tree5a291b2decb6fd3014126a468c005c2cbf524972 /test/linter
parente81f005c78193b9475b359751e9fae21f65c1c2b (diff)
downloadale-0f55d371e92160812ff0a57b5f48f2010a420f0c.zip
Add neovim 0.6 to run-tests (#3998)
* Update test scripts * Remove neovim 0.3 and 0.4 * Add neovim 0.6.1 Co-authored-by: Horacio Sanson <horacio@allm.inc> Co-authored-by: w0rp <devw0rp@gmail.com>
Diffstat (limited to 'test/linter')
-rw-r--r--test/linter/test_cpp_cppcheck.vader2
-rw-r--r--test/linter/test_cspell.vader2
-rw-r--r--test/linter/test_flake8.vader20
-rw-r--r--test/linter/test_flakehell.vader19
-rw-r--r--test/linter/test_haml_hamllint.vader2
-rw-r--r--test/linter/test_haskell_hie.vader4
-rw-r--r--test/linter/test_less_stylelint.vader1
-rw-r--r--test/linter/test_ocaml_ols.vader1
-rw-r--r--test/linter/test_php_langserver.vader2
-rw-r--r--test/linter/test_psalm.vader1
-rw-r--r--test/linter/test_pyflakes.vader1
-rw-r--r--test/linter/test_pylsp.vader1
-rw-r--r--test/linter/test_pyre.vader1
-rw-r--r--test/linter/test_reason_ols.vader1
-rw-r--r--test/linter/test_rust_analyzer.vader9
-rw-r--r--test/linter/test_rust_rls.vader9
-rw-r--r--test/linter/test_rustc.vader4
-rw-r--r--test/linter/test_scss_stylelint.vader2
-rw-r--r--test/linter/test_sugarss_stylelint.vader2
-rw-r--r--test/linter/test_terraform_ls.vader21
-rw-r--r--test/linter/test_terraform_lsp.vader21
-rw-r--r--test/linter/test_vim_vimls.vader3
22 files changed, 60 insertions, 69 deletions
diff --git a/test/linter/test_cpp_cppcheck.vader b/test/linter/test_cpp_cppcheck.vader
index 21d6707d..880bcb41 100644
--- a/test/linter/test_cpp_cppcheck.vader
+++ b/test/linter/test_cpp_cppcheck.vader
@@ -5,7 +5,7 @@ Before:
After:
" Remove a test file we might open for some tests.
if &buftype != 'nofile'
- :q!
+ set nomodified
set buftype=nofile
endif
diff --git a/test/linter/test_cspell.vader b/test/linter/test_cspell.vader
index 7a72be44..0302edc5 100644
--- a/test/linter/test_cspell.vader
+++ b/test/linter/test_cspell.vader
@@ -60,6 +60,8 @@ Execute(Should let users configure a global executable and override local paths)
\ . ' lint --no-color --no-progress --no-summary -- stdin'
Execute(Additional cspell options should be configurable):
+ call ale#test#SetFilename('../test-files/dummy')
+
let g:ale_cspell_options = '--foobar'
AssertLinter
diff --git a/test/linter/test_flake8.vader b/test/linter/test_flake8.vader
index 0b87c27b..53b40b29 100644
--- a/test/linter/test_flake8.vader
+++ b/test/linter/test_flake8.vader
@@ -56,7 +56,7 @@ Execute(The option for disabling changing directories should work):
\]
Execute(The option for changing directory to project root should work):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_tox/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_tox/namespace/foo/bar.py')
AssertLinterCwd ale#python#FindProjectRootIni(bufnr(''))
call ale#semver#ResetVersionCache()
@@ -67,7 +67,7 @@ Execute(The option for changing directory to project root should work):
Execute(The option for changing directory to file dir should work):
let g:ale_python_flake8_change_directory = 'file'
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_tox/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_tox/namespace/foo/bar.py')
AssertLinter 'flake8', [
\ ale#Escape('flake8') . ' --version',
@@ -98,6 +98,8 @@ Execute(The flake8 command callback should let you set options):
\]
Execute(You should be able to set a custom executable and it should be escaped):
+ call ale#test#SetFilename('../test-files/dummy')
+
let g:ale_python_flake8_executable = 'executable with spaces'
AssertLinterCwd ['%s:h', '%s:h']
@@ -110,7 +112,7 @@ Execute(You should be able to set a custom executable and it should be escaped):
\]
Execute(The flake8 callbacks should detect virtualenv directories):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Simplify(
\ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/flake8'
@@ -124,35 +126,35 @@ Execute(The flake8 callbacks should detect virtualenv directories):
\]
Execute(The FindProjectRoot should detect the project root directory for namespace package via Manifest.in):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_manifest/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_manifest/namespace/foo/bar.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/python/namespace_package_manifest'),
\ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via setup.cf):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_setup/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_setup/namespace/foo/bar.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/python/namespace_package_setup'),
\ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via pytest.ini):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_pytest/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_pytest/namespace/foo/bar.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/python/namespace_package_pytest'),
\ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via tox.ini):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_tox/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_tox/namespace/foo/bar.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/python/namespace_package_tox'),
\ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for non-namespace package):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/no_virtualenv/subdir/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/no_virtualenv/subdir/foo/bar.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/python/no_virtualenv/subdir'),
@@ -160,7 +162,7 @@ Execute(The FindProjectRoot should detect the project root directory for non-nam
" Some users currently run flake8 this way, so we should support it.
Execute(Using `python -m flake8` should be supported for running flake8):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
let g:ale_python_flake8_executable = 'python'
let g:ale_python_flake8_options = '-m flake8 --some-option'
diff --git a/test/linter/test_flakehell.vader b/test/linter/test_flakehell.vader
index fa7cb9e3..98314408 100644
--- a/test/linter/test_flakehell.vader
+++ b/test/linter/test_flakehell.vader
@@ -48,7 +48,7 @@ Execute(The option for disabling changing directories should work):
\]
Execute(The option for changing directory to project root should work):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_tox/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_tox/namespace/foo/bar.py')
AssertLinterCwd ale#python#FindProjectRootIni(bufnr(''))
call ale#semver#ResetVersionCache()
@@ -59,7 +59,7 @@ Execute(The option for changing directory to project root should work):
Execute(The option for changing directory to file dir should work):
let g:ale_python_flakehell_change_directory = 'file'
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_tox/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_tox/namespace/foo/bar.py')
AssertLinter 'flakehell', [
\ ale#Escape('flakehell') . ' --version',
@@ -84,6 +84,7 @@ Execute(The flakehell command callback should let you set options):
Execute(You should be able to set a custom executable and it should be escaped):
let g:ale_python_flakehell_executable = 'executable with spaces'
+ call ale#test#SetFilename('../test-files/dummy')
AssertLinterCwd ['%s:h', '%s:h']
call ale#semver#ResetVersionCache()
@@ -96,7 +97,7 @@ Execute(You should be able to set a custom executable and it should be escaped):
\]
Execute(The flakehell callbacks should detect virtualenv directories):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Simplify(
\ g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/flakehell'
@@ -111,35 +112,35 @@ Execute(The flakehell callbacks should detect virtualenv directories):
\]
Execute(The FindProjectRoot should detect the project root directory for namespace package via Manifest.in):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_manifest/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_manifest/namespace/foo/bar.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/python/namespace_package_manifest'),
\ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via setup.cf):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_setup/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_setup/namespace/foo/bar.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/python/namespace_package_setup'),
\ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via pytest.ini):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_pytest/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_pytest/namespace/foo/bar.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/python/namespace_package_pytest'),
\ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via tox.ini):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/namespace_package_tox/namespace/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/namespace_package_tox/namespace/foo/bar.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/python/namespace_package_tox'),
\ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for non-namespace package):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/no_virtualenv/subdir/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/no_virtualenv/subdir/foo/bar.py')
AssertEqual
\ ale#path#Simplify(g:dir . '/../test-files/python/no_virtualenv/subdir'),
@@ -147,7 +148,7 @@ Execute(The FindProjectRoot should detect the project root directory for non-nam
" Some users currently run flakehell this way, so we should support it.
Execute(Using `python -m flakehell` should be supported for running flakehell):
- silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
+ call ale#test#SetFilename('../test-files/python/with_virtualenv/subdir/foo/bar.py')
let g:ale_python_flakehell_executable = 'python'
let g:ale_python_flakehell_options = '--some-option'
diff --git a/test/linter/test_haml_hamllint.vader b/test/linter/test_haml_hamllint.vader
index 9d81179b..1f5e2fa4 100644
--- a/test/linter/test_haml_hamllint.vader
+++ b/test/linter/test_haml_hamllint.vader
@@ -38,4 +38,6 @@ Execute(The command should include a .rubocop.yml and a .haml-lint if both are f
Execute(The executable can be overridden):
let b:ale_haml_hamllint_executable = 'bin/haml-lint'
+ call ale#test#SetFilename('../test-files/dummy')
+
AssertLinter 'bin/haml-lint', 'bin/haml-lint %t'
diff --git a/test/linter/test_haskell_hie.vader b/test/linter/test_haskell_hie.vader
index 5bd2794c..3cababad 100644
--- a/test/linter/test_haskell_hie.vader
+++ b/test/linter/test_haskell_hie.vader
@@ -17,9 +17,9 @@ Execute(The default executable should be correct):
Execute(The project root should be detected correctly):
AssertLSPProject g:dir
- call ale#test#SetFilename('hie_paths/file.hs')
+ call ale#test#SetFilename('../test-files/hie_paths/file.hs')
- AssertLSPProject ale#path#Simplify(g:dir . '/hie_paths')
+ AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/hie_paths')
Execute(The executable should be configurable):
let g:ale_haskell_hie_executable = 'foobar'
diff --git a/test/linter/test_less_stylelint.vader b/test/linter/test_less_stylelint.vader
index cbe7d23c..c27af79e 100644
--- a/test/linter/test_less_stylelint.vader
+++ b/test/linter/test_less_stylelint.vader
@@ -26,6 +26,7 @@ Execute(The global override should work):
Execute(Extra options should be configurable):
let b:ale_less_stylelint_options = '--whatever'
+ call ale#test#SetFilename('../test-files/dummy')
AssertLinter 'stylelint',
\ ale#Escape('stylelint') . ' --whatever --stdin-filename %s'
diff --git a/test/linter/test_ocaml_ols.vader b/test/linter/test_ocaml_ols.vader
index bf9ae65b..89734dce 100644
--- a/test/linter/test_ocaml_ols.vader
+++ b/test/linter/test_ocaml_ols.vader
@@ -36,5 +36,6 @@ Execute(The gloabl executable should always be used when use_global is set):
Execute(The executable should be configurable):
let g:ale_ocaml_ols_executable = 'foobar'
+ call ale#test#SetFilename('../test-files/dummy')
AssertLinter 'foobar', ale#Escape('foobar') . ' --stdio'
diff --git a/test/linter/test_php_langserver.vader b/test/linter/test_php_langserver.vader
index 7fe20b82..28741713 100644
--- a/test/linter/test_php_langserver.vader
+++ b/test/linter/test_php_langserver.vader
@@ -5,6 +5,8 @@ After:
call ale#assert#TearDownLinterTest()
Execute(The default executable path should be correct):
+ call ale#test#SetFilename('../test-files/dummy')
+
AssertLinter 'php-language-server.php',
\ 'php ' . ale#Escape('php-language-server.php')
diff --git a/test/linter/test_psalm.vader b/test/linter/test_psalm.vader
index b79f2724..94e718d4 100644
--- a/test/linter/test_psalm.vader
+++ b/test/linter/test_psalm.vader
@@ -32,6 +32,7 @@ Execute(Vendor executables should be detected):
Execute(User provided options should be used):
let g:ale_php_psalm_options = '--my-user-provided-option my-value'
+ call ale#test#SetFilename('../test-files/dummy')
AssertLinter 'psalm',
\ ale#Escape('psalm')
diff --git a/test/linter/test_pyflakes.vader b/test/linter/test_pyflakes.vader
index bd442098..61aee562 100644
--- a/test/linter/test_pyflakes.vader
+++ b/test/linter/test_pyflakes.vader
@@ -34,6 +34,7 @@ Execute(You should be able to override the pyflakes virtualenv lookup):
Execute(Setting executable to 'pipenv' appends 'run pyflakes'):
let g:ale_python_pyflakes_executable = 'path/to/pipenv'
+ call ale#test#SetFilename('../test-files/dummy')
AssertLinter 'path/to/pipenv',
\ ale#Escape('path/to/pipenv') . ' run pyflakes %t',
diff --git a/test/linter/test_pylsp.vader b/test/linter/test_pylsp.vader
index acee2c3f..290fdbf3 100644
--- a/test/linter/test_pylsp.vader
+++ b/test/linter/test_pylsp.vader
@@ -41,6 +41,7 @@ Execute(You should be able to override the pylsp virtualenv lookup):
Execute(Setting executable to 'pipenv' appends 'run pylsp'):
let g:ale_python_pylsp_executable = 'path/to/pipenv'
+ call ale#test#SetFilename('../test-files/dummy')
AssertLinter 'path/to/pipenv', ale#Escape('path/to/pipenv') . ' run pylsp'
diff --git a/test/linter/test_pyre.vader b/test/linter/test_pyre.vader
index 53f84e6f..331d97ed 100644
--- a/test/linter/test_pyre.vader
+++ b/test/linter/test_pyre.vader
@@ -34,6 +34,7 @@ Execute(You should be able to override the pyre virtualenv lookup):
Execute(Setting executable to 'pipenv' appends 'run pyre'):
let g:ale_python_pyre_executable = 'path/to/pipenv'
+ call ale#test#SetFilename('../test-files/dummy')
AssertLinter 'path/to/pipenv',
\ ale#Escape('path/to/pipenv') . ' run pyre persistent'
diff --git a/test/linter/test_reason_ols.vader b/test/linter/test_reason_ols.vader
index 752bd05b..fb90e36f 100644
--- a/test/linter/test_reason_ols.vader
+++ b/test/linter/test_reason_ols.vader
@@ -37,5 +37,6 @@ Execute(The gloabl executable should always be used when use_global is set):
Execute(The executable should be configurable):
let g:ale_reason_ols_executable = 'foobar'
+ call ale#test#SetFilename('../test-files/dummy')
AssertLinter 'foobar', ale#Escape('foobar') . ' --stdio'
diff --git a/test/linter/test_rust_analyzer.vader b/test/linter/test_rust_analyzer.vader
index 2ee996c7..1dd2c780 100644
--- a/test/linter/test_rust_analyzer.vader
+++ b/test/linter/test_rust_analyzer.vader
@@ -8,19 +8,20 @@ Execute(The default executable path should be correct):
AssertLinter 'rust-analyzer', ale#Escape('rust-analyzer')
Execute(The project root should be detected correctly in cargo projects):
- AssertLSPProject ''
-
call ale#test#SetFilename('../test-files/rust/cargo/testfile.rs')
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/rust/cargo')
Execute(The project root should be detected correctly in non-cargo projects):
- AssertLSPProject ''
-
call ale#test#SetFilename('../test-files/rust/rust-project/testfile.rs')
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/rust/rust-project')
+Execute(The project root should be empty when no project files can be detected):
+ call ale#test#SetFilename('../test-files/dummy')
+
+ AssertLSPProject ''
+
Execute(Should accept configuration settings):
AssertLSPConfig {}
let b:ale_rust_analyzer_config = {'diagnostics': {'disabled': ['unresolved-import']}}
diff --git a/test/linter/test_rust_rls.vader b/test/linter/test_rust_rls.vader
index 0b684c52..62c90d61 100644
--- a/test/linter/test_rust_rls.vader
+++ b/test/linter/test_rust_rls.vader
@@ -17,13 +17,16 @@ Execute(The toolchain should be ommitted if not given):
AssertLinter 'rls', ale#Escape('rls')
-Execute(The project root should be detected correctly):
- AssertLSPProject ''
-
+Execute(The project root should be detected correctly for cargo projects):
call ale#test#SetFilename('../test-files/rust/cargo/testfile.rs')
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/rust/cargo')
+Execute(The project root should be empty when no project files can be detected):
+ call ale#test#SetFilename('../test-files/dummy')
+
+ AssertLSPProject ''
+
Execute(Should accept configuration settings):
AssertLSPConfig {}
let b:ale_rust_rls_config = {'rust': {'clippy_preference': 'on'}}
diff --git a/test/linter/test_rustc.vader b/test/linter/test_rustc.vader
index 37b7a8c2..92d9fa14 100644
--- a/test/linter/test_rustc.vader
+++ b/test/linter/test_rustc.vader
@@ -5,9 +5,13 @@ After:
call ale#assert#TearDownLinterTest()
Execute(The default command should be correct):
+ call ale#test#SetFilename('../test-files/dummy')
+
AssertLinter 'rustc', 'rustc --error-format=json --emit=mir -o /dev/null -'
Execute(The options should be configurable):
+ call ale#test#SetFilename('../test-files/dummy')
+
let b:ale_rust_rustc_options = '--foo'
AssertLinter 'rustc', 'rustc --error-format=json --foo -'
diff --git a/test/linter/test_scss_stylelint.vader b/test/linter/test_scss_stylelint.vader
index 5a1e71c6..bf45ccd0 100644
--- a/test/linter/test_scss_stylelint.vader
+++ b/test/linter/test_scss_stylelint.vader
@@ -25,6 +25,8 @@ Execute(The global override should work):
AssertLinter 'foobar', ale#Escape('foobar') . ' --stdin-filename %s'
Execute(Extra options should be configurable):
+ call ale#test#SetFilename('../test-files/dummy')
+
let b:ale_scss_stylelint_options = '--configFile ''/absolute/path/to/file'''
AssertLinter 'stylelint',
diff --git a/test/linter/test_sugarss_stylelint.vader b/test/linter/test_sugarss_stylelint.vader
index ba42eaf8..c6000a9a 100644
--- a/test/linter/test_sugarss_stylelint.vader
+++ b/test/linter/test_sugarss_stylelint.vader
@@ -25,6 +25,8 @@ Execute(The global override should work):
AssertLinter 'foobar', ale#Escape('foobar') . ' --syntax=sugarss --stdin-filename %s'
Execute(Extra options should be configurable):
+ call ale#test#SetFilename('../test-files/dummy')
+
let b:ale_sugarss_stylelint_options = '--configFile ''/absolute/path/to/file'''
AssertLinter 'stylelint',
diff --git a/test/linter/test_terraform_ls.vader b/test/linter/test_terraform_ls.vader
index 9f7d3450..983bc104 100644
--- a/test/linter/test_terraform_ls.vader
+++ b/test/linter/test_terraform_ls.vader
@@ -2,10 +2,6 @@ Before:
call ale#assert#SetUpLinterTest('terraform', 'terraform_ls')
After:
- if isdirectory(g:dir . '/.terraform')
- call delete(g:dir . '/.terraform', 'd')
- endif
-
unlet! b:ale_terraform_terraform_executable
unlet! b:ale_terraform_ls_executable
unlet! b:ale_terraform_ls_options
@@ -40,22 +36,7 @@ Execute(Should set custom options):
AssertLinter 'terraform-ls',
\ ale#Escape('terraform-ls') . ' serve --bar'
-Execute(Should return current directory if it contains .terraform directory):
- call mkdir(g:dir . '/.terraform')
- AssertLSPProject g:dir
-
Execute(Should return nearest directory with .terraform if found in parent directory):
call ale#test#SetFilename('../test-files/terraform/main.tf')
- let b:parent_dir = ale#path#Simplify(g:dir . '/..')
- let b:tf_dir = b:parent_dir . '/.terraform'
-
- if !isdirectory(b:tf_dir)
- call mkdir(b:tf_dir)
- endif
-
- AssertLSPProject b:parent_dir
-
- call delete(b:tf_dir, 'd')
- unlet!b:parent_dir
- unlet!b:tf_dir
+ AssertLSPProject ale#test#GetFilename('../test-files/terraform')
diff --git a/test/linter/test_terraform_lsp.vader b/test/linter/test_terraform_lsp.vader
index a292fca0..27f27ffb 100644
--- a/test/linter/test_terraform_lsp.vader
+++ b/test/linter/test_terraform_lsp.vader
@@ -2,10 +2,6 @@ Before:
call ale#assert#SetUpLinterTest('terraform', 'terraform_lsp')
After:
- if isdirectory(g:dir . '/.terraform')
- call delete(g:dir . '/.terraform', 'd')
- endif
-
unlet! b:ale_terraform_langserver_executable
unlet! b:ale_terraform_langserver_options
@@ -27,22 +23,7 @@ Execute(Should set custom options):
AssertLinter 'terraform-lsp',
\ ale#Escape('terraform-lsp') . ' --bar'
-Execute(Should return current directory if it contains .terraform directory):
- call mkdir(g:dir . '/.terraform')
- AssertLSPProject g:dir
-
Execute(Should return nearest directory with .terraform if found in parent directory):
call ale#test#SetFilename('../test-files/terraform/main.tf')
- let b:parent_dir = ale#path#Simplify(g:dir . '/..')
- let b:tf_dir = b:parent_dir . '/.terraform'
-
- if !isdirectory(b:tf_dir)
- call mkdir(b:tf_dir)
- endif
-
- AssertLSPProject b:parent_dir
-
- call delete(b:tf_dir, 'd')
- unlet!b:parent_dir
- unlet!b:tf_dir
+ AssertLSPProject ale#test#GetFilename('../test-files/terraform')
diff --git a/test/linter/test_vim_vimls.vader b/test/linter/test_vim_vimls.vader
index 47826a1a..eb9239a2 100644
--- a/test/linter/test_vim_vimls.vader
+++ b/test/linter/test_vim_vimls.vader
@@ -70,7 +70,8 @@ Execute(should let the global executable to be used):
AssertLinter 'vim-language-server',
\ ale#Escape('vim-language-server') . ' --stdio'
-Execute(should let the executable to be configured):
+Execute(should allow the executable to be configured):
let g:ale_vim_vimls_executable = 'foobar'
+ call ale#test#SetFilename('../test-files/dummy')
AssertLinter 'foobar', ale#Escape('foobar') . ' --stdio'