summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
Diffstat (limited to 'test/command_callback')
-rwxr-xr-xtest/command_callback/html_beautify_paths/html-beautify0
-rw-r--r--test/command_callback/html_beautify_paths/test.html0
-rw-r--r--test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/mypy.ini0
-rw-r--r--test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/tests/pytest.ini0
-rw-r--r--test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/tests/testsubfolder/my_tests.py0
-rw-r--r--test/command_callback/test_c_clangd_command_callbacks.vader12
-rw-r--r--test/command_callback/test_cpp_clangcheck_command_callbacks.vader6
-rw-r--r--test/command_callback/test_mypy_command_callback.vader9
-rw-r--r--test/command_callback/test_psalm_command_callbacks.vader8
-rw-r--r--test/command_callback/test_standardts_command_callback.vader43
10 files changed, 67 insertions, 11 deletions
diff --git a/test/command_callback/html_beautify_paths/html-beautify b/test/command_callback/html_beautify_paths/html-beautify
new file mode 100755
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/html_beautify_paths/html-beautify
diff --git a/test/command_callback/html_beautify_paths/test.html b/test/command_callback/html_beautify_paths/test.html
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/html_beautify_paths/test.html
diff --git a/test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/mypy.ini b/test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/mypy.ini
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/mypy.ini
diff --git a/test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/tests/pytest.ini b/test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/tests/pytest.ini
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/tests/pytest.ini
diff --git a/test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/tests/testsubfolder/my_tests.py b/test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/tests/testsubfolder/my_tests.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/python_paths/with_mypy_ini_and_pytest_ini/tests/testsubfolder/my_tests.py
diff --git a/test/command_callback/test_c_clangd_command_callbacks.vader b/test/command_callback/test_c_clangd_command_callbacks.vader
index 555122f6..753dc9a8 100644
--- a/test/command_callback/test_c_clangd_command_callbacks.vader
+++ b/test/command_callback/test_c_clangd_command_callbacks.vader
@@ -9,18 +9,14 @@ Before:
Save b:ale_c_build_dir_names
Save b:ale_c_parse_compile_commands
- let b:command_tail = ' -x c'
-
After:
- unlet! b:command_tail
-
call ale#assert#TearDownLinterTest()
Execute(The language string should be correct):
AssertLSPLanguage 'c'
Execute(The default executable should be correct):
- AssertLinter 'clangd', ale#Escape('clangd') . b:command_tail
+ AssertLinter 'clangd', ale#Escape('clangd')
Execute(The project root should be detected correctly):
call ale#test#SetFilename(tempname() . '/dummy.c')
@@ -34,12 +30,12 @@ Execute(The project root should be detected correctly):
Execute(The executable should be configurable):
let g:ale_c_clangd_executable = 'foobar'
- AssertLinter 'foobar', ale#Escape('foobar') . b:command_tail
+ AssertLinter 'foobar', ale#Escape('foobar')
Execute(The options should be configurable):
let b:ale_c_clangd_options = '-compile-commands-dir=foo'
- AssertLinter 'clangd', ale#Escape('clangd') . b:command_tail . ' ' . b:ale_c_clangd_options
+ AssertLinter 'clangd', ale#Escape('clangd') . ' ' . b:ale_c_clangd_options
Execute(The compile command database should be detected correctly):
call ale#test#SetFilename('clangd_paths/with_build_dir/dummy_src/dummy.c')
@@ -49,7 +45,7 @@ Execute(The compile command database should be detected correctly):
let b:ale_c_build_dir_names = ['unusual_build_dir_name']
let b:ale_c_parse_compile_commands = 1
- AssertLinter 'clangd', ale#Escape('clangd') . b:command_tail
+ AssertLinter 'clangd', ale#Escape('clangd')
\ . ' -compile-commands-dir='
\ . ale#Escape(ale#path#Simplify(g:dir . '/clangd_paths/with_build_dir/unusual_build_dir_name'))
diff --git a/test/command_callback/test_cpp_clangcheck_command_callbacks.vader b/test/command_callback/test_cpp_clangcheck_command_callbacks.vader
index 7aa09eed..188141d5 100644
--- a/test/command_callback/test_cpp_clangcheck_command_callbacks.vader
+++ b/test/command_callback/test_cpp_clangcheck_command_callbacks.vader
@@ -7,7 +7,7 @@ After:
Execute(The executable should be configurable):
AssertLinter 'clang-check',
\ ale#Escape('clang-check')
- \ . ' -analyze %s -extra-arg -Xclang -extra-arg -analyzer-output=text'
+ \ . ' -analyze %s --extra-arg=-Xclang --extra-arg=-analyzer-output=text --extra-arg=-fno-color-diagnostics'
let b:ale_cpp_clangcheck_executable = 'foobar'
@@ -15,7 +15,7 @@ Execute(The executable should be configurable):
" being generated.
AssertLinter 'foobar',
\ ale#Escape('foobar')
- \ . ' -analyze %s -extra-arg -Xclang -extra-arg -analyzer-output=text'
+ \ . ' -analyze %s --extra-arg=-Xclang --extra-arg=-analyzer-output=text --extra-arg=-fno-color-diagnostics'
Execute(The options should be configurable):
let b:ale_cpp_clangcheck_options = '--something'
@@ -23,7 +23,7 @@ Execute(The options should be configurable):
AssertLinter 'clang-check',
\ ale#Escape('clang-check')
\ . ' -analyze %s'
- \ . ' -extra-arg -Xclang -extra-arg -analyzer-output=text'
+ \ . ' --extra-arg=-Xclang --extra-arg=-analyzer-output=text --extra-arg=-fno-color-diagnostics'
\ . ' --something'
Execute(The build directory should be used when set):
diff --git a/test/command_callback/test_mypy_command_callback.vader b/test/command_callback/test_mypy_command_callback.vader
index 8ca35207..afa9f9af 100644
--- a/test/command_callback/test_mypy_command_callback.vader
+++ b/test/command_callback/test_mypy_command_callback.vader
@@ -52,6 +52,15 @@ Execute(The mypy callbacks should detect virtualenv directories and switch to th
\ . ' --show-column-numbers '
\ . '--shadow-file %s %t %s'
+Execute(The mypy callbacks should cd to directory containing mypy.ini if found):
+ silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_mypy_ini_and_pytest_ini/tests/testsubfolder/my_tests.py')
+
+ AssertLinter 'mypy',
+ \ ale#path#CdString(ale#path#Simplify(g:dir . '/python_paths/with_mypy_ini_and_pytest_ini'))
+ \ . ale#Escape('mypy')
+ \ . ' --show-column-numbers '
+ \ . '--shadow-file %s %t %s'
+
Execute(You should able able to use the global mypy instead):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
let g:ale_python_mypy_use_global = 1
diff --git a/test/command_callback/test_psalm_command_callbacks.vader b/test/command_callback/test_psalm_command_callbacks.vader
index 74c68d43..70b5af95 100644
--- a/test/command_callback/test_psalm_command_callbacks.vader
+++ b/test/command_callback/test_psalm_command_callbacks.vader
@@ -22,6 +22,14 @@ Execute(Vendor executables should be detected):
\ . '/psalm-project/vendor/bin/psalm'
\ )) . ' --language-server'
+Execute(User provided options should be used):
+ let g:ale_psalm_langserver_options = '--my-user-provided-option my-value'
+
+ AssertLinter 'psalm',
+ \ ale#Escape('psalm')
+ \ . ' --language-server --my-user-provided-option my-value'
+
+
Execute(The project path should be correct for .git directories):
call ale#test#SetFilename('psalm-project/test.php')
diff --git a/test/command_callback/test_standardts_command_callback.vader b/test/command_callback/test_standardts_command_callback.vader
new file mode 100644
index 00000000..d769e712
--- /dev/null
+++ b/test/command_callback/test_standardts_command_callback.vader
@@ -0,0 +1,43 @@
+Before:
+ call ale#assert#SetUpLinterTest('typescript', 'standard')
+ call ale#test#SetFilename('testfile.js')
+ unlet! b:executable
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(bin/cmd.js paths should be preferred):
+ call ale#test#SetFilename('standard-test-files/with-cmd/testfile.js')
+
+ let b:executable = ale#path#Simplify(
+ \ g:dir
+ \ . '/standard-test-files/with-cmd/node_modules/standard/bin/cmd.js'
+ \)
+
+ AssertLinter b:executable,
+ \ (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(b:executable)
+ \ . ' --stdin %s'
+
+Execute(.bin directories should be used too):
+ call ale#test#SetFilename('standard-test-files/with-bin/testfile.js')
+
+ let b:executable = ale#path#Simplify(
+ \ g:dir
+ \ . '/standard-test-files/with-bin/node_modules/.bin/standard'
+ \)
+
+ AssertLinter b:executable, ale#Escape(b:executable) . ' --stdin %s'
+
+Execute(The global executable should be used otherwise):
+ AssertLinter 'standard', ale#Escape('standard') . ' --stdin %s'
+
+Execute(The global executable should be configurable):
+ let b:ale_typescript_standard_executable = 'foobar'
+
+ AssertLinter 'foobar', ale#Escape('foobar') . ' --stdin %s'
+
+Execute(The options should be configurable):
+ let b:ale_typescript_standard_options = '--wat'
+
+ AssertLinter 'standard', ale#Escape('standard') . ' --wat --stdin %s'