summaryrefslogtreecommitdiff
path: root/test/handler/test_lessc_handler.vader
blob: 530c5824079e57ec47d5d0963a4b5e4d40f5c6dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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    ',
  \])