summaryrefslogtreecommitdiff
path: root/test/test_history_saving.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-06-06 19:54:10 +0100
committerw0rp <devw0rp@gmail.com>2017-06-06 19:54:10 +0100
commitef86a8a389842b4de5196bd458e2014bc63da238 (patch)
tree2578e52746f31076d106c8b89e607ffa7ba0bd36 /test/test_history_saving.vader
parent9dadde190e2d691c375cde9e2d6988b11f40285a (diff)
downloadale-ef86a8a389842b4de5196bd458e2014bc63da238.zip
Make the test for the history more reliable
Diffstat (limited to 'test/test_history_saving.vader')
-rw-r--r--test/test_history_saving.vader10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/test_history_saving.vader b/test/test_history_saving.vader
index 2f1044d7..8207d153 100644
--- a/test/test_history_saving.vader
+++ b/test/test_history_saving.vader
@@ -1,4 +1,7 @@
Before:
+ Save g:ale_max_buffer_history_size
+ Save g:ale_history_log_output
+
" Temporarily set the shell to /bin/sh, if it isn't already set that way.
" This will make it so the test works when running it directly.
let g:current_shell = &shell
@@ -6,6 +9,7 @@ Before:
let g:history = []
let g:ale_buffer_info = {}
let g:ale_max_buffer_history_size = 20
+ let g:ale_history_log_output = 0
function! CollectResults(buffer, output)
return []
@@ -15,11 +19,13 @@ Before:
\ 'name': 'testlinter',
\ 'callback': 'CollectResults',
\ 'executable': 'echo',
- \ 'command': 'echo command history test',
+ \ 'command': '/bin/sh -c ''echo command history test''',
\ 'read_buffer': 0,
\})
After:
+ Restore
+
" Reset the shell back to what it was before.
let &shell = g:current_shell
unlet g:current_shell
@@ -44,7 +50,7 @@ Execute(History should be set when commands are run):
AssertEqual 1, len(g:history)
AssertEqual sort(['status', 'exit_code', 'job_id', 'command']), sort(keys(g:history[0]))
- AssertEqual ['/bin/sh', '-c', 'echo command history test'], g:history[0].command
+ AssertEqual ['/bin/sh', '-c', '/bin/sh -c ''echo command history test'''], g:history[0].command
AssertEqual 'finished', g:history[0].status
AssertEqual 0, g:history[0].exit_code
" The Job ID will change each time, but we can check the type.