summaryrefslogtreecommitdiff
path: root/test/test_linter_defintion_processing.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2021-03-01 20:11:10 +0000
committerw0rp <devw0rp@gmail.com>2021-03-01 20:11:10 +0000
commit9fe7b1fe6a23fb55e6d782293585d58193123f59 (patch)
tree0403deb70011aee7be08e586b10b5828cf69499e /test/test_linter_defintion_processing.vader
parent48fab99a0ab793e1b9607795c21659f12bd6947f (diff)
downloadale-9fe7b1fe6a23fb55e6d782293585d58193123f59.zip
Close #2281 - Separate cwd commands from commands
Working directories are now set seperately from the commands so they can later be swapped out when running linters over projects is supported, and also better support filename mapping for running linters on other machines in future.
Diffstat (limited to 'test/test_linter_defintion_processing.vader')
-rw-r--r--test/test_linter_defintion_processing.vader30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/test_linter_defintion_processing.vader b/test/test_linter_defintion_processing.vader
index d000b158..fa1b6786 100644
--- a/test/test_linter_defintion_processing.vader
+++ b/test/test_linter_defintion_processing.vader
@@ -89,6 +89,34 @@ Execute (PreProcess should allow command to be a callback):
\ 'command': function('type'),
\})
+Execute (PreProcess should throw when cwd is not a string):
+ AssertThrows call ale#linter#PreProcess('testft', {
+ \ 'name': 'foo',
+ \ 'callback': 'SomeFunction',
+ \ 'executable': 'echo',
+ \ 'cwd': [],
+ \ 'command': 'echo',
+ \})
+ AssertEqual '`cwd` must be a String or Function if defined', g:vader_exception
+
+Execute (PreProcess should allow cwd to be a callback):
+ call ale#linter#PreProcess('testft', {
+ \ 'name': 'foo',
+ \ 'callback': 'SomeFunction',
+ \ 'executable': 'echo',
+ \ 'cwd': function('type'),
+ \ 'command': 'echo',
+ \})
+
+Execute (PreProcess should allow cwd to be a string):
+ call ale#linter#PreProcess('testft', {
+ \ 'name': 'foo',
+ \ 'callback': 'SomeFunction',
+ \ 'executable': 'echo',
+ \ 'cwd': '/foo/bar',
+ \ 'command': 'echo',
+ \})
+
Execute (PreProcess should when the output stream isn't a valid string):
AssertThrows call ale#linter#PreProcess('testft', {
\ 'name': 'foo',
@@ -305,7 +333,7 @@ Execute(PreProcess should complain about invalid language values):
\}
AssertThrows call ale#linter#PreProcess('testft', g:linter)
- AssertEqual '`language` must be a String or Funcref if defined', g:vader_exception
+ AssertEqual '`language` must be a String or Function if defined', g:vader_exception
Execute(PreProcess should use the filetype as the language string by default):
let g:linter = {