diff options
Diffstat (limited to 'test/command_callback')
-rw-r--r--[-rwxr-xr-x] | test/command_callback/ink_paths/story/main.ink (renamed from test/command_callback/psalm-project/vendor/bin/psalm-language-server) | 0 | ||||
-rwxr-xr-x | test/command_callback/psalm-project/vendor/bin/psalm | 0 | ||||
-rw-r--r-- | test/command_callback/test_ink_ls_command_callbacks.vader | 22 | ||||
-rw-r--r-- | test/command_callback/test_languagetool_command_callback.vader | 9 | ||||
-rw-r--r-- | test/command_callback/test_markdown_mdl_command_callback.vader | 6 | ||||
-rw-r--r-- | test/command_callback/test_psalm_command_callbacks.vader | 10 | ||||
-rw-r--r-- | test/command_callback/test_scala_metals.vader | 20 | ||||
-rw-r--r-- | test/command_callback/test_solc_command_callback.vader | 13 |
8 files changed, 71 insertions, 9 deletions
diff --git a/test/command_callback/psalm-project/vendor/bin/psalm-language-server b/test/command_callback/ink_paths/story/main.ink index e69de29b..e69de29b 100755..100644 --- a/test/command_callback/psalm-project/vendor/bin/psalm-language-server +++ b/test/command_callback/ink_paths/story/main.ink diff --git a/test/command_callback/psalm-project/vendor/bin/psalm b/test/command_callback/psalm-project/vendor/bin/psalm new file mode 100755 index 00000000..e69de29b --- /dev/null +++ b/test/command_callback/psalm-project/vendor/bin/psalm diff --git a/test/command_callback/test_ink_ls_command_callbacks.vader b/test/command_callback/test_ink_ls_command_callbacks.vader new file mode 100644 index 00000000..5074506c --- /dev/null +++ b/test/command_callback/test_ink_ls_command_callbacks.vader @@ -0,0 +1,22 @@ +Before: + call ale#assert#SetUpLinterTest('ink', 'ls') + set ft=ink + +After: + call ale#assert#TearDownLinterTest() + +Execute(should set correct defaults): + AssertLinter 'ink-language-server', ale#Escape('ink-language-server') . ' --stdio' + +Execute(should set correct LSP values): + call ale#test#SetFilename('ink_paths/story/main.ink') + + AssertLSPLanguage 'ink' + AssertLSPOptions {} + AssertLSPConfig {} + AssertLSPProject ale#path#Simplify(g:dir . '/ink_paths/story') + +Execute(should accept configuration settings): + AssertLSPConfig {} + let b:ale_ink_ls_initialization_options = {'ink': {'runThroughMono': v:true}} + AssertLSPOptions {'ink': {'runThroughMono': v:true}} diff --git a/test/command_callback/test_languagetool_command_callback.vader b/test/command_callback/test_languagetool_command_callback.vader index a79662b9..ff6b2064 100644 --- a/test/command_callback/test_languagetool_command_callback.vader +++ b/test/command_callback/test_languagetool_command_callback.vader @@ -12,4 +12,11 @@ Execute(Should be able to set a custom executable): let g:ale_languagetool_executable = 'foobar' AssertLinter 'foobar' , ale#Escape('foobar') - \ . ' --autoDetect %s' + \ . ' --autoDetect %s' + +Execute(Should be able to include custom languagetool options): + let g:ale_languagetool_options = '--language en' + + " is now 'foobar' based on above global + AssertLinter 'foobar', ale#Escape('foobar') + \ . ' --language en %s' diff --git a/test/command_callback/test_markdown_mdl_command_callback.vader b/test/command_callback/test_markdown_mdl_command_callback.vader index e029bf9b..1ce4db1a 100644 --- a/test/command_callback/test_markdown_mdl_command_callback.vader +++ b/test/command_callback/test_markdown_mdl_command_callback.vader @@ -5,15 +5,15 @@ After: call ale#assert#TearDownLinterTest() Execute(The default command should be correct): - AssertLinter 'mdl', ale#Escape('mdl') + AssertLinter 'mdl', ale#Escape('mdl') . ' -j' Execute(The executable and options should be configurable): let g:ale_markdown_mdl_executable = 'foo bar' let g:ale_markdown_mdl_options = '--wat' - AssertLinter 'foo bar', ale#Escape('foo bar') . ' --wat' + AssertLinter 'foo bar', ale#Escape('foo bar') . ' -j --wat' Execute(Setting bundle appends 'exec mdl'): let g:ale_markdown_mdl_executable = 'path to/bundle' - AssertLinter 'path to/bundle', ale#Escape('path to/bundle') . ' exec mdl' + AssertLinter 'path to/bundle', ale#Escape('path to/bundle') . ' exec mdl -j' diff --git a/test/command_callback/test_psalm_command_callbacks.vader b/test/command_callback/test_psalm_command_callbacks.vader index 33d770c2..74c68d43 100644 --- a/test/command_callback/test_psalm_command_callbacks.vader +++ b/test/command_callback/test_psalm_command_callbacks.vader @@ -9,18 +9,18 @@ After: call ale#assert#TearDownLinterTest() Execute(The default executable path should be correct): - AssertLinter 'psalm-language-server', - \ ale#Escape('psalm-language-server') + AssertLinter 'psalm', + \ ale#Escape('psalm') . ' --language-server' Execute(Vendor executables should be detected): call ale#test#SetFilename('psalm-project/test.php') AssertLinter - \ ale#path#Simplify(g:dir . '/psalm-project/vendor/bin/psalm-language-server'), + \ ale#path#Simplify(g:dir . '/psalm-project/vendor/bin/psalm'), \ ale#Escape(ale#path#Simplify( \ g:dir - \ . '/psalm-project/vendor/bin/psalm-language-server' - \ )) + \ . '/psalm-project/vendor/bin/psalm' + \ )) . ' --language-server' 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_scala_metals.vader b/test/command_callback/test_scala_metals.vader new file mode 100644 index 00000000..70e14c1a --- /dev/null +++ b/test/command_callback/test_scala_metals.vader @@ -0,0 +1,20 @@ +" Author: Jeffrey Lau https://github.com/zoonfafer +" Description: Tests for the Scala Metals linter + +Before: + call ale#assert#SetUpLinterTest('scala', 'metals') + +After: + call ale#assert#TearDownLinterTest() +Execute(should set metals for sbt project with build.sbt): + call ale#test#SetFilename('../scala_fixtures/valid_sbt_project/Main.scala') + AssertLSPLanguage 'scala' + AssertLSPOptions {} + AssertLSPConfig {} + AssertLSPProject ale#path#Simplify(g:dir . 'command_callback/../scala_fixtures/valid_sbt_project') +Execute(should not set metals for sbt project without build.sbt): + call ale#test#SetFilename('../scala_fixtures/invalid_sbt_project/Main.scala') + AssertLSPLanguage 'scala' + AssertLSPOptions {} + AssertLSPConfig {} + AssertLSPProject '' diff --git a/test/command_callback/test_solc_command_callback.vader b/test/command_callback/test_solc_command_callback.vader new file mode 100644 index 00000000..23521f6a --- /dev/null +++ b/test/command_callback/test_solc_command_callback.vader @@ -0,0 +1,13 @@ +Before: + call ale#assert#SetUpLinterTest('solidity', 'solc') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The default command should be correct): + AssertLinter 'solc', 'solc %s' + +Execute(The options should be configurable): + let g:ale_solidity_solc_options = '--foobar' + + AssertLinter 'solc', 'solc --foobar %s' |