2017-11-12 06:35:01 -05:00
|
|
|
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',
|
2017-12-19 13:23:09 -05:00
|
|
|
\ 'filename': ale#path#Simplify(g:dir . '/imported.less')
|
2017-11-12 06:35:01 -05:00
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 2,
|
|
|
|
\ 'col': 1,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Unrecognised input. Possibly missing something',
|
2017-12-19 13:23:09 -05:00
|
|
|
\ 'filename': ale#path#Simplify(g:dir . '/imported.less')
|
2017-11-12 06:35:01 -05:00
|
|
|
\ },
|
|
|
|
\ ],
|
|
|
|
\ 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',
|
2017-12-19 13:23:09 -05:00
|
|
|
\ 'filename': ale#path#Simplify(g:dir . '/../imported2.less')
|
2017-11-12 06:35:01 -05:00
|
|
|
\ },
|
|
|
|
\ ],
|
|
|
|
\ ale_linters#less#lessc#Handle(bufnr(''), [
|
|
|
|
\ 'ParseError: Unrecognised input. Possibly missing something in ../imported2.less on line 2, column 1:',
|
|
|
|
\ '1 vwewww',
|
|
|
|
\ '2 ',
|
|
|
|
\])
|