summaryrefslogtreecommitdiff
path: root/test/handler/test_swipl_handler.vader
diff options
context:
space:
mode:
authorHoracio Sanson <hsanson@gmail.com>2021-01-20 12:00:55 -0500
committerD. Ben Knoble <ben.knoble+github@gmail.com>2021-01-20 12:08:05 -0500
commit80a0108fcfa93876c03e7e74110d11e398561cb0 (patch)
treeed415efc0ab102fa0a5d2ce841283e2be9fa61e3 /test/handler/test_swipl_handler.vader
parent6a3d215571662bfc97d2d415dfbec4bc217eda62 (diff)
downloadale-80a0108fcfa93876c03e7e74110d11e398561cb0.zip
prolog/swipl: cover new format with complex tests
https://github.com/dense-analysis/ale/pull/3377#issuecomment-763628447
Diffstat (limited to 'test/handler/test_swipl_handler.vader')
-rw-r--r--test/handler/test_swipl_handler.vader44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/handler/test_swipl_handler.vader b/test/handler/test_swipl_handler.vader
index 7986c6a1..81b8b9e5 100644
--- a/test/handler/test_swipl_handler.vader
+++ b/test/handler/test_swipl_handler.vader
@@ -95,6 +95,50 @@ Execute (The swipl handler should ignore warnings / errors 'No permission to cal
\ ' vimscript: (multifile A)',
\ ])
+Execute (The swipl handler should join three or more lines with '. ' on latest swipl):
+ call ale#test#SetFilename('test.pl')
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 10,
+ \ 'col': 0,
+ \ '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',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#prolog#swipl#Handle(bufnr(''), [
+ \ 'Warning: /path/to/test.pl:10:',
+ \ 'Warning: Clauses of fib/2 are not together in the source-file',
+ \ 'Warning: Earlier definition at /path/to/test.pl:7',
+ \ 'Warning: Current predicate: f/0',
+ \ 'Warning: Use :- discontiguous fib/2. to suppress this message',
+ \ ])
+
+Execute (The swipl handler should ignore warnings / errors 'No permission to call sandboxed with latest swpl...'):
+ call ale#test#SetFilename('test.pl')
+ AssertEqual
+ \ [],
+ \ ale_linters#prolog#swipl#Handle(bufnr(''), [
+ \ 'ERROR: /path/to/test.pl:11:',
+ \ 'ERROR: No permission to call sandboxed `''$set_predicate_attribute''(_G3416:_G3417,_G3413,_G3414)''',
+ \ 'ERROR: Reachable from:',
+ \ 'ERROR: system:''$set_pattr''(A,B,C,D)',
+ \ 'ERROR: system:''$set_pattr''(vimscript:A,B,C)',
+ \ 'ERROR: vimscript: (multifile A)',
+ \ 'ERROR: /path/to/test.pl:12:',
+ \ 'ERROR: No permission to call sandboxed `''$set_predicate_attribute''(_G205:_G206,_G202,_G203)''',
+ \ 'ERROR: Reachable from:',
+ \ 'ERROR: system:''$set_pattr''(A,B,C,D)',
+ \ 'ERROR: system:''$set_pattr''(vimscript:A,B,C)',
+ \ 'ERROR: vimscript: (multifile A)',
+ \ 'ERROR: /path/to/test.pl:13:',
+ \ 'ERROR: No permission to call sandboxed `''$set_predicate_attribute''(_G1808:_G1809,_G1805,_G1806)''',
+ \ 'ERROR: Reachable from:',
+ \ 'ERROR: system:''$set_pattr''(A,B,C,D)',
+ \ 'ERROR: system:''$set_pattr''(vimscript:A,B,C)',
+ \ 'ERROR: vimscript: (multifile A)',
+ \ ])
+
Execute (The swipl handler should handle a warning / error with no line number):
call ale#test#SetFilename('test.pl')
AssertEqual