summaryrefslogtreecommitdiff
path: root/test/linter/test_solhint.vader
diff options
context:
space:
mode:
authorHenrique Barcelos <hbarcelos@users.noreply.github.com>2021-04-14 21:01:18 -0300
committerGitHub <noreply@github.com>2021-04-15 09:01:18 +0900
commit1c90d8c01875f5abb815fea29eb4545bd9a940c0 (patch)
tree3d0ad474315bf910af5b3da43aa90467f57a77b6 /test/linter/test_solhint.vader
parent1cd0c0c33b211b5fface9b29f9c58bc6ae09323e (diff)
downloadale-1c90d8c01875f5abb815fea29eb4545bd9a940c0.zip
Updated `solhint` linter to be able to use a local installation (#3682)
* fix: added support for local solhint executable * feat: added support for matching parse errors * test: added test for solhint command callback and handler * chore: removed command callback test * refactor: made solhint handler structure closer to eslint
Diffstat (limited to 'test/linter/test_solhint.vader')
-rw-r--r--test/linter/test_solhint.vader28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/linter/test_solhint.vader b/test/linter/test_solhint.vader
new file mode 100644
index 00000000..fc5afa9b
--- /dev/null
+++ b/test/linter/test_solhint.vader
@@ -0,0 +1,28 @@
+Before:
+ call ale#assert#SetUpLinterTest('solidity', 'solhint')
+ runtime autoload/ale/handlers/solhint.vim
+
+ let b:args = ' --formatter compact %s'
+
+After:
+ unlet! b:args
+ unlet! b:executable
+ call ale#assert#TearDownLinterTest()
+
+Execute(The default command should be correct):
+ AssertLinterCwd ''
+ AssertLinter 'solhint', ale#Escape('solhint') . b:args
+
+Execute(The options should be configurable):
+ let g:ale_solidity_solhint_options = '--foobar'
+
+ AssertLinter 'solhint', ale#Escape('solhint') . ' --foobar' . b:args
+
+
+Execute(solhint should be run from a containing project with solhint executable):
+ call ale#test#SetFilename('../test-files/solhint/Contract.sol')
+
+ let b:executable = ale#path#Simplify(g:dir . '/../test-files/solhint/node_modules/.bin/solhint')
+
+ AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/solhint')
+ AssertLinter b:executable, ale#Escape(b:executable) . b:args