summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorFranco Victorio <victorio.franco@gmail.com>2017-12-04 14:23:46 -0300
committerFranco Victorio <victorio.franco@gmail.com>2017-12-04 14:23:46 -0300
commit57e1b03435c94cd93748a87ee9fbd285452d91ca (patch)
tree5659d87abc1d456d42144c82826f5e90498fa1e1 /test/handler
parent3e1bd8d922c2be22fdaa24ce2d11bafa636375a7 (diff)
downloadale-57e1b03435c94cd93748a87ee9fbd285452d91ca.zip
Add test for solhint handler
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_solhint_handler.vader54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/handler/test_solhint_handler.vader b/test/handler/test_solhint_handler.vader
new file mode 100644
index 00000000..43e3505c
--- /dev/null
+++ b/test/handler/test_solhint_handler.vader
@@ -0,0 +1,54 @@
+Before:
+ runtime ale_linters/solidity/solhint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The vint handler should parse error messages correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'col': 17,
+ \ 'text': 'Compiler version must be fixed (compiler-fixed)',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 4,
+ \ 'col': 8,
+ \ 'text': 'Use double quotes for string literals (quotes)',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 5,
+ \ 'col': 8,
+ \ 'text': 'Use double quotes for string literals (quotes)',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 13,
+ \ 'col': 3,
+ \ 'text': 'Expected indentation of 4 spaces but found 2 (indent)',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 14,
+ \ 'col': 3,
+ \ 'text': 'Expected indentation of 4 spaces but found 2 (indent)',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'lnum': 47,
+ \ 'col': 3,
+ \ 'text': 'Function order is incorrect, public function can not go after internal function. (func-order)',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#solidity#solhint#Handle(bufnr(''), [
+ \ 'contracts/Bounty.sol: line 1, col 17, Warning - Compiler version must be fixed (compiler-fixed)',
+ \ 'contracts/Bounty.sol: line 4, col 8, Error - Use double quotes for string literals (quotes)',
+ \ 'contracts/Bounty.sol: line 5, col 8, Error - Use double quotes for string literals (quotes)',
+ \ 'contracts/Bounty.sol: line 13, col 3, Error - Expected indentation of 4 spaces but found 2 (indent)',
+ \ 'contracts/Bounty.sol: line 14, col 3, Error - Expected indentation of 4 spaces but found 2 (indent)',
+ \ 'contracts/Bounty.sol: line 47, col 3, Error - Function order is incorrect, public function can not go after internal function. (func-order)',
+ \ ])