]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_swipl_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / test / handler / test_swipl_handler.vader
1 Before:
2   runtime ale_linters/prolog/swipl.vim
3
4 After:
5   call ale#linter#Reset()
6
7 Execute (The swipl handler should handle oneline warning / error):
8   call ale#test#SetFilename('test.pl')
9   AssertEqual
10   \ [
11   \   {
12   \     'lnum': 5,
13   \     'col': 1,
14   \     'text': 'Syntax error: Operator expected',
15   \     'type': 'E',
16   \   },
17   \ ],
18   \ ale_linters#prolog#swipl#Handle(bufnr(''), [
19   \   'ERROR: /path/to/test.pl:5:1: Syntax error: Operator expected',
20   \ ])
21
22 Execute (The swipl handler should handle a warning / error of two lines):
23   call ale#test#SetFilename('test.pl')
24   AssertEqual
25   \ [
26   \   {
27   \     'lnum': 9,
28   \     'col': 0,
29   \     'text': 'Singleton variables: [M]',
30   \     'type': 'W',
31   \   },
32   \ ],
33   \ ale_linters#prolog#swipl#Handle(bufnr(''), [
34   \   'Warning: /path/to/test.pl:9:',
35   \   '        Singleton variables: [M]',
36   \ ])
37
38 Execute (The swipl handler should handle a warning / error of two lines in the new format):
39   call ale#test#SetFilename('test.pl')
40   AssertEqual
41   \ [
42   \   {
43   \     'lnum': 9,
44   \     'col': 0,
45   \     'text': 'Singleton variables: [M]',
46   \     'type': 'W',
47   \   },
48   \ ],
49   \ ale_linters#prolog#swipl#Handle(bufnr(''), [
50   \   'Warning: /path/to/test.pl:9:',
51   \   'Warning:        Singleton variables: [M]',
52   \ ])
53
54 Execute (The swipl handler should join three or more lines with '. '):
55   call ale#test#SetFilename('test.pl')
56   AssertEqual
57   \ [
58   \   {
59   \     'lnum': 10,
60   \     'col': 0,
61   \     'text': 'Clauses of fib/2 are not together in the source-file. Earlier definition at /path/to/test.pl:7. Current predicate: f/0. Use :- discontiguous fib/2. to suppress this message',
62   \     'type': 'W',
63   \   },
64   \ ],
65   \ ale_linters#prolog#swipl#Handle(bufnr(''), [
66   \   'Warning: /path/to/test.pl:10:',
67   \   '        Clauses of fib/2 are not together in the source-file',
68   \   '          Earlier definition at /path/to/test.pl:7',
69   \   '          Current predicate: f/0',
70   \   '          Use :- discontiguous fib/2. to suppress this message',
71   \ ])
72
73 Execute (The swipl handler should ignore warnings / errors 'No permission to call sandboxed ...'):
74   call ale#test#SetFilename('test.pl')
75   AssertEqual
76   \ [],
77   \ ale_linters#prolog#swipl#Handle(bufnr(''), [
78   \   'ERROR: /path/to/test.pl:11:',
79   \   '        No permission to call sandboxed `''$set_predicate_attribute''(_G3416:_G3417,_G3413,_G3414)''',
80   \   '        Reachable from:',
81   \   '                  system:''$set_pattr''(A,B,C,D)',
82   \   '                  system:''$set_pattr''(vimscript:A,B,C)',
83   \   '                  vimscript: (multifile A)',
84   \   'ERROR: /path/to/test.pl:12:',
85   \   '        No permission to call sandboxed `''$set_predicate_attribute''(_G205:_G206,_G202,_G203)''',
86   \   '        Reachable from:',
87   \   '                  system:''$set_pattr''(A,B,C,D)',
88   \   '                  system:''$set_pattr''(vimscript:A,B,C)',
89   \   '                  vimscript: (multifile A)',
90   \   'ERROR: /path/to/test.pl:13:',
91   \   '        No permission to call sandboxed `''$set_predicate_attribute''(_G1808:_G1809,_G1805,_G1806)''',
92   \   '        Reachable from:',
93   \   '                  system:''$set_pattr''(A,B,C,D)',
94   \   '                  system:''$set_pattr''(vimscript:A,B,C)',
95   \   '                  vimscript: (multifile A)',
96   \ ])
97
98 Execute (The swipl handler should join three or more lines with '. ' on latest swipl):
99   call ale#test#SetFilename('test.pl')
100   AssertEqual
101   \ [
102   \   {
103   \     'lnum': 10,
104   \     'col': 0,
105   \     'text': 'Clauses of fib/2 are not together in the source-file. Earlier definition at /path/to/test.pl:7. Current predicate: f/0. Use :- discontiguous fib/2. to suppress this message',
106   \     'type': 'W',
107   \   },
108   \ ],
109   \ ale_linters#prolog#swipl#Handle(bufnr(''), [
110   \   'Warning: /path/to/test.pl:10:',
111   \   'Warning:        Clauses of fib/2 are not together in the source-file',
112   \   'Warning:          Earlier definition at /path/to/test.pl:7',
113   \   'Warning:          Current predicate: f/0',
114   \   'Warning:          Use :- discontiguous fib/2. to suppress this message',
115   \ ])
116
117 Execute (The swipl handler should ignore warnings / errors 'No permission to call sandboxed with latest swpl...'):
118   call ale#test#SetFilename('test.pl')
119   AssertEqual
120   \ [],
121   \ ale_linters#prolog#swipl#Handle(bufnr(''), [
122   \   'ERROR: /path/to/test.pl:11:',
123   \   'ERROR:        No permission to call sandboxed `''$set_predicate_attribute''(_G3416:_G3417,_G3413,_G3414)''',
124   \   'ERROR:        Reachable from:',
125   \   'ERROR:                  system:''$set_pattr''(A,B,C,D)',
126   \   'ERROR:                  system:''$set_pattr''(vimscript:A,B,C)',
127   \   'ERROR:                  vimscript: (multifile A)',
128   \   'ERROR: /path/to/test.pl:12:',
129   \   'ERROR:        No permission to call sandboxed `''$set_predicate_attribute''(_G205:_G206,_G202,_G203)''',
130   \   'ERROR:        Reachable from:',
131   \   'ERROR:                  system:''$set_pattr''(A,B,C,D)',
132   \   'ERROR:                  system:''$set_pattr''(vimscript:A,B,C)',
133   \   'ERROR:                  vimscript: (multifile A)',
134   \   'ERROR: /path/to/test.pl:13:',
135   \   'ERROR:        No permission to call sandboxed `''$set_predicate_attribute''(_G1808:_G1809,_G1805,_G1806)''',
136   \   'ERROR:        Reachable from:',
137   \   'ERROR:                  system:''$set_pattr''(A,B,C,D)',
138   \   'ERROR:                  system:''$set_pattr''(vimscript:A,B,C)',
139   \   'ERROR:                  vimscript: (multifile A)',
140   \ ])
141
142 Execute (The swipl handler should handle a warning / error with no line number):
143   call ale#test#SetFilename('test.pl')
144   AssertEqual
145   \ [
146   \   {
147   \     'lnum': 1,
148   \     'col': 0,
149   \     'text': 'Exported procedure module_name:pred/0 is not defined',
150   \     'type': 'E',
151   \   },
152   \ ],
153   \ ale_linters#prolog#swipl#Handle(bufnr(''), [
154   \   'ERROR: Exported procedure module_name:pred/0 is not defined',
155   \ ])