]> git.madduck.net Git - etc/vim.git/blobdiff - .vim/bundle/ale/test/handler/test_idris_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_idris_handler.vader
diff --git a/.vim/bundle/ale/test/handler/test_idris_handler.vader b/.vim/bundle/ale/test/handler/test_idris_handler.vader
new file mode 100644 (file)
index 0000000..6a032ea
--- /dev/null
@@ -0,0 +1,66 @@
+Before:
+  Save $TMPDIR
+
+  " Set TMPDIR so the temporary file checks work.
+  let $TMPDIR = '/tmp'
+
+  runtime ale_linters/idris/idris.vim
+
+After:
+  Restore
+
+  call ale#linter#Reset()
+
+Execute(The idris handler should parse messages that reference a single column):
+  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(''), [
+  \   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(''), [
+  \   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',
+  \ ])