summaryrefslogtreecommitdiff
path: root/test/test_ale_info.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-02-16 23:18:57 +0000
committerw0rp <devw0rp@gmail.com>2017-02-16 23:18:57 +0000
commiteac0a41ae1aba77e1d017833425fa8132130df13 (patch)
tree1bd9b6f30a43b3066236937df5e88341559fae33 /test/test_ale_info.vader
parent843370b96f9a92a2298ed7985a8f620784fc9421 (diff)
downloadale-eac0a41ae1aba77e1d017833425fa8132130df13.zip
#254 Add an option for logging the output of commands
Diffstat (limited to 'test/test_ale_info.vader')
-rw-r--r--test/test_ale_info.vader64
1 files changed, 64 insertions, 0 deletions
diff --git a/test/test_ale_info.vader b/test/test_ale_info.vader
index 92025f23..ecea899b 100644
--- a/test/test_ale_info.vader
+++ b/test/test_ale_info.vader
@@ -41,6 +41,7 @@ After:
unlet! g:globals_string
unlet! g:command_header
let g:ale_buffer_info = {}
+ let g:ale_history_log_output = 0
unlet! g:ale_testft_testlinter1_foo
unlet! g:ale_testft_testlinter1_bar
unlet! g:ale_testft2_testlinter2_foo
@@ -218,3 +219,66 @@ Execute (ALEInfo command history should print exit codes correctly):
\ '(finished - exit code 1) [''/bin/bash'', ''\c'', ''last command'']',
\ ], "\n"),
\ g:output
+
+Given testft.testft2 (Empty buffer with two filetypes):
+Execute (ALEInfo command history should print command output if logging is on):
+ let g:ale_history_log_output = 1
+
+ let g:ale_buffer_info[bufnr('%')] = {
+ \ 'history': [
+ \ {
+ \ 'status': 'finished',
+ \ 'exit_code': 0,
+ \ 'job_id': 347,
+ \ 'command': 'first command',
+ \ 'output': ['some', 'first command output'],
+ \ },
+ \ {
+ \ 'status': 'finished',
+ \ 'exit_code': 1,
+ \ 'job_id': 347,
+ \ 'command': ['/bin/bash', '\c', 'last command'],
+ \ 'output': ['different second command output'],
+ \ },
+ \ {
+ \ 'status': 'finished',
+ \ 'exit_code': 0,
+ \ 'job_id': 347,
+ \ 'command': 'command with no output',
+ \ 'output': [],
+ \ },
+ \ ],
+ \}
+
+ call ale#linter#Define('testft', g:testlinter1)
+ call ale#linter#Define('testft2', g:testlinter2)
+ redir => g:output
+ silent ALEInfo
+ redir END
+ AssertEqual
+ \ join([
+ \ '',
+ \ ' Current Filetype: testft.testft2',
+ \ 'Available Linters: [''testlinter1'', ''testlinter2'']',
+ \ ' Enabled Linters: [''testlinter1'', ''testlinter2'']',
+ \ ' Linter Variables:',
+ \ g:globals_string . g:command_header,
+ \ '(finished - exit code 0) ''first command''',
+ \ '',
+ \ '<<<OUTPUT STARTS>>>',
+ \ 'some',
+ \ 'first command output',
+ \ '<<<OUTPUT ENDS>>>',
+ \ '',
+ \ '(finished - exit code 1) [''/bin/bash'', ''\c'', ''last command'']',
+ \ '',
+ \ '<<<OUTPUT STARTS>>>',
+ \ 'different second command output',
+ \ '<<<OUTPUT ENDS>>>',
+ \ '',
+ \ '(finished - exit code 0) ''command with no output''',
+ \ '',
+ \ '<<<NO OUTPUT RETURNED>>>',
+ \ '',
+ \ ], "\n"),
+ \ g:output