summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-12 11:35:01 +0000
committerw0rp <devw0rp@gmail.com>2017-11-12 11:35:01 +0000
commit7edcb2210b2b60d5eaf81381e5d9443369576c28 (patch)
tree5261596fe241c24b6e1550e04f74db8f6dab9ce3 /test/handler
parentcd5da50531d55c003de495d8b151c60c5dbf26eb (diff)
downloadale-7edcb2210b2b60d5eaf81381e5d9443369576c28.zip
Show problems from other files for lessc
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_lessc_handler.vader69
1 files changed, 69 insertions, 0 deletions
diff --git a/test/handler/test_lessc_handler.vader b/test/handler/test_lessc_handler.vader
new file mode 100644
index 00000000..530c5824
--- /dev/null
+++ b/test/handler/test_lessc_handler.vader
@@ -0,0 +1,69 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/handler')
+ call ale#test#SetFilename('testfile.less')
+
+ runtime ale_linters/less/lessc.vim
+
+After:
+ call ale#test#RestoreDirectory()
+ call ale#linter#Reset()
+
+Execute(The lessc handler should handle errors for the current file correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'Unrecognised input. Possibly missing something',
+ \ },
+ \ ],
+ \ ale_linters#less#lessc#Handle(bufnr(''), [
+ \ 'ParseError: Unrecognised input. Possibly missing something in - on line 2, column 1:',
+ \ '1 vwewww',
+ \ '2 ',
+ \])
+
+Execute(The lessc handler should handle errors for other files in the same directory correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'Unrecognised input. Possibly missing something',
+ \ 'filename': ale#path#Winify(g:dir . '/imported.less')
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'Unrecognised input. Possibly missing something',
+ \ 'filename': ale#path#Winify(g:dir . '/imported.less')
+ \ },
+ \ ],
+ \ ale_linters#less#lessc#Handle(bufnr(''), [
+ \ 'ParseError: Unrecognised input. Possibly missing something in imported.less on line 2, column 1:',
+ \ '1 vwewww',
+ \ '2 ',
+ \ 'ParseError: Unrecognised input. Possibly missing something in ./imported.less on line 2, column 1:',
+ \ '1 vwewww',
+ \ '2 ',
+ \])
+
+Execute(The lessc handler should handle errors for files in directories above correctly):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 2,
+ \ 'col': 1,
+ \ 'type': 'E',
+ \ 'text': 'Unrecognised input. Possibly missing something',
+ \ 'filename': ale#path#Winify(g:dir . '/../imported2.less')
+ \ },
+ \ ],
+ \ ale_linters#less#lessc#Handle(bufnr(''), [
+ \ 'ParseError: Unrecognised input. Possibly missing something in ../imported2.less on line 2, column 1:',
+ \ '1 vwewww',
+ \ '2 ',
+ \])