summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRemi Thebault <remi.thebault@gmail.com>2021-03-30 08:47:59 +0200
committerGitHub <noreply@github.com>2021-03-30 15:47:59 +0900
commit06f57ca9733aab6e6b67015917fdfd4bf1c70c48 (patch)
tree3081dd7c24980f84736fe47fb1112dc6c127a5aa /test
parent655f0070cd2ce575f81092d1faac739fd116b515 (diff)
downloadale-06f57ca9733aab6e6b67015917fdfd4bf1c70c48.zip
improve DMD handler (#3647)
* improve DMD handler - ignore errors from other files - catch 'Deprecation' as warning - add tests * adding filename key instead of filtering * update dmd test * fix test dmd windows
Diffstat (limited to 'test')
-rw-r--r--test/handler/test_dmd_handler.vader41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/handler/test_dmd_handler.vader b/test/handler/test_dmd_handler.vader
new file mode 100644
index 00000000..32a04982
--- /dev/null
+++ b/test/handler/test_dmd_handler.vader
@@ -0,0 +1,41 @@
+Before:
+ runtime ale_linters/d/dmd.vim
+ call ale#test#SetDirectory('/testplugin/test/dmd')
+ call ale#test#SetFilename('test.d')
+
+After:
+ call ale#linter#Reset()
+ call ale#test#RestoreDirectory()
+
+Execute(Basic errors should be handled by dmd):
+ AssertEqual
+ \ [
+ \ {
+ \ 'filename': ale#path#Simplify(g:dir . '/test.d'),
+ \ 'lnum': '5',
+ \ 'col' : '8',
+ \ 'type': 'E',
+ \ 'text': 'module weak_reference is in file ''dstruct/weak_reference.d'' which cannot be read'
+ \ },
+ \ {
+ \ 'filename': ale#path#Simplify(g:dir . '/test.d'),
+ \ 'lnum': '20',
+ \ 'col' : '10',
+ \ 'type': 'W',
+ \ 'text': 'function test.thisoldfunc is deprecated'
+ \ },
+ \ {
+ \ 'filename': ale#path#Simplify(g:dir . '/foo.d'),
+ \ 'lnum': '230',
+ \ 'col' : '9',
+ \ 'type': 'W',
+ \ 'text': 'statement is not reachable'
+ \ }
+ \ ],
+ \ ale_linters#d#dmd#Handle(bufnr(''), [
+ \ 'test.d(5,8): Error: module weak_reference is in file ''dstruct/weak_reference.d'' which cannot be read',
+ \ 'import path[0] = source',
+ \ 'import path[1] = /usr/include/dlang/dmd',
+ \ ale#path#Simplify(g:dir . '/test.d') . '(20,10): Deprecation: function test.thisoldfunc is deprecated',
+ \ 'foo.d(230,9): Warning: statement is not reachable',
+ \ ])