ale/test/handler/test_solhint_handler.vader

61 lines
1.9 KiB
Plaintext
Raw Normal View History

2017-12-04 12:23:46 -05:00
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,
2017-12-05 14:02:15 -05:00
\ 'text': 'Compiler version must be fixed',
\ 'code': 'compiler-fixed',
2017-12-04 12:23:46 -05:00
\ 'type': 'W',
\ },
\ {
\ 'lnum': 4,
\ 'col': 8,
2017-12-05 14:02:15 -05:00
\ 'text': 'Use double quotes for string literals',
\ 'code': 'quotes',
2017-12-04 12:23:46 -05:00
\ 'type': 'E',
\ },
\ {
\ 'lnum': 5,
\ 'col': 8,
2017-12-05 14:02:15 -05:00
\ 'text': 'Use double quotes for string literals',
\ 'code': 'quotes',
2017-12-04 12:23:46 -05:00
\ 'type': 'E',
\ },
\ {
\ 'lnum': 13,
\ 'col': 3,
2017-12-05 14:02:15 -05:00
\ 'text': 'Expected indentation of 4 spaces but found 2',
\ 'code': 'indent',
2017-12-04 12:23:46 -05:00
\ 'type': 'E',
\ },
\ {
\ 'lnum': 14,
\ 'col': 3,
2017-12-05 14:02:15 -05:00
\ 'text': 'Expected indentation of 4 spaces but found 2',
\ 'code': 'indent',
2017-12-04 12:23:46 -05:00
\ 'type': 'E',
\ },
\ {
\ 'lnum': 47,
\ 'col': 3,
2017-12-05 14:02:15 -05:00
\ 'text': 'Function order is incorrect, public function can not go after internal function.',
\ 'code': 'func-order',
2017-12-04 12:23:46 -05:00
\ '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)',
\ ])