ale/test/handler/test_idris_handler.vader

67 lines
2.1 KiB
Plaintext
Raw Normal View History

Before:
2017-09-11 17:25:15 -04:00
Save $TMPDIR
" Set TMPDIR so the temporary file checks work.
let $TMPDIR = '/tmp'
runtime ale_linters/idris/idris.vim
2017-09-11 17:25:15 -04:00
After:
Restore
call ale#linter#Reset()
Execute(The idris handler should parse messages that reference a single column):
2017-10-01 13:41:41 -04:00
if has('win32')
call ale#test#SetFilename($TEMP . '\foo.idr')
else
call ale#test#SetFilename('/tmp/foo.idr')
endif
AssertEqual
\ [
\ {
\ 'lnum': 4,
\ 'col': 5,
\ 'type': 'E',
\ 'text': 'When checking right hand side of main with expected type IO () When checking an application of function Prelude.Monad.>>=: Type mismatch between IO () (Type of putStrLn _) and _ -> _ (Is putStrLn _ applied to too many arguments?) Specifically: Type mismatch between IO and \uv => _ -> uv'
\ }
\ ],
\ ale_linters#idris#idris#Handle(bufnr(''), [
2017-10-01 13:41:41 -04:00
\ expand('%:p') . ':4:5:',
\ 'When checking right hand side of main with expected type',
\ ' IO ()',
\ '',
\ 'When checking an application of function Prelude.Monad.>>=:',
\ ' Type mismatch between',
\ ' IO () (Type of putStrLn _)',
\ ' and',
\ ' _ -> _ (Is putStrLn _ applied to too many arguments?)',
\ '',
\ ' Specifically:',
\ ' Type mismatch between',
\ ' IO',
\ ' and',
\ ' \uv => _ -> uv',
\ ])
Execute(The idris handler should parse messages that reference a column range):
call ale#test#SetFilename('/tmp/foo.idr')
AssertEqual
\ [
\ {
\ 'lnum': 11,
\ 'col': 11,
\ 'type': 'E',
\ 'text': 'When checking right hand side of Main.case block in main at /tmp/foo.idr:10:10 with expected type IO () Last statement in do block must be an expression'
\ }
\ ],
\ ale_linters#idris#idris#Handle(bufnr(''), [
2017-10-01 13:41:41 -04:00
\ expand('%:p') . ':11:11-13:',
\ 'When checking right hand side of Main.case block in main at /tmp/foo.idr:10:10 with expected type',
\ ' IO ()',
\ '',
\ 'Last statement in do block must be an expression',
\ ])