diff options
author | w0rp <devw0rp@gmail.com> | 2017-04-29 17:33:18 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-04-29 17:33:18 +0100 |
commit | 0b4acd645395d4196f2e346d65aeddf063927f4e (patch) | |
tree | 2701b1faefec6e1cc2dbfd5775d3bf94c6a5e022 /test/handler/test_gometalinter_handler.vader | |
parent | cbb01e32b950f4a5c14d56b41759945662b2db49 (diff) | |
download | ale-0b4acd645395d4196f2e346d65aeddf063927f4e.zip |
Fix #518 Fix handling of spaces in filenames for various linters
Diffstat (limited to 'test/handler/test_gometalinter_handler.vader')
-rw-r--r-- | test/handler/test_gometalinter_handler.vader | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test/handler/test_gometalinter_handler.vader b/test/handler/test_gometalinter_handler.vader new file mode 100644 index 00000000..3b622130 --- /dev/null +++ b/test/handler/test_gometalinter_handler.vader @@ -0,0 +1,53 @@ +Before: + runtime ale_linters/go/gometalinter.vim + +After: + call ale#linter#Reset() + +Execute (The gometalinter handler should handle names with spaces): + " We can't test Windows paths with the path resovling on Linux, but we can + " test the regex. + AssertEqual + \ [ + \ [ + \ 'C:\something\file with spaces.go', + \ '12', + \ '3', + \ 'warning', + \ 'expected ''package'', found ''IDENT'' gibberish (staticcheck)', + \ ], + \ [ + \ 'C:\something\file with spaces.go', + \ '37', + \ '5', + \ 'error', + \ 'expected ''package'', found ''IDENT'' gibberish (golint)', + \ ], + \ ], + \ map(ale_linters#go#gometalinter#GetMatches([ + \ 'C:\something\file with spaces.go:12:3:warning: expected ''package'', found ''IDENT'' gibberish (staticcheck)', + \ 'C:\something\file with spaces.go:37:5:error: expected ''package'', found ''IDENT'' gibberish (golint)', + \ ]), 'v:val[1:5]') + +Execute (The gometalinter handler should handle relative paths correctly): + :file! /foo/bar/baz.go + + AssertEqual + \ [ + \ { + \ 'lnum': 12, + \ 'col': 3, + \ 'text': 'expected ''package'', found ''IDENT'' gibberish (staticcheck)', + \ 'type': 'W', + \ }, + \ { + \ 'lnum': 37, + \ 'col': 5, + \ 'text': 'expected ''package'', found ''IDENT'' gibberish (golint)', + \ 'type': 'E', + \ }, + \ ], + \ ale_linters#go#gometalinter#Handler(42, [ + \ 'baz.go:12:3:warning: expected ''package'', found ''IDENT'' gibberish (staticcheck)', + \ 'baz.go:37:5:error: expected ''package'', found ''IDENT'' gibberish (golint)', + \ ]) |