summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-05-21 14:01:58 +0100
committerw0rp <devw0rp@gmail.com>2019-05-21 14:01:58 +0100
commitf6ae056d02e82143f26db49b642d2f6d82d12cde (patch)
tree117757f4c39b52f4c3bf5385ad8bba4f8dfd2dc3
parent3e3801e81ef70d3b35b7c527fbd1b4f62d50bae5 (diff)
downloadale-f6ae056d02e82143f26db49b642d2f6d82d12cde.zip
Stop a test from failing randomly
-rw-r--r--test/test_ale_info.vader15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/test_ale_info.vader b/test/test_ale_info.vader
index 29c19b8e..c723dba3 100644
--- a/test/test_ale_info.vader
+++ b/test/test_ale_info.vader
@@ -145,9 +145,12 @@ Before:
After:
Restore
+ if exists('g:info_test_file') && filereadable(g:info_test_file)
+ call delete(g:info_test_file)
+ endif
+
unlet! g:testlinter1
unlet! g:testlinter2
-
unlet! b:ale_history
unlet! b:ale_linters
unlet! g:output
@@ -160,6 +163,7 @@ After:
unlet! g:ale_testft2_testlinter2_foo
unlet! b:ale_testft2_testlinter2_foo
unlet! g:ale_testft2_testlinter2_bar
+ unlet! g:info_test_file
delfunction CheckInfo
call ale#test#RestoreDirectory()
@@ -333,10 +337,6 @@ Execute (ALEInfo should return appropriately named global variables):
\)
Execute (ALEInfoToFile should write to a file correctly):
- if filereadable(g:dir . '/ale-info-test-file')
- call delete(g:dir . '/ale-info-test-file')
- endif
-
let g:ale_testft_testlinter1_foo = 'abc'
let g:ale_testft_testlinter1_bar = ['abc']
let g:ale_testft2_testlinter2_foo = 123
@@ -345,7 +345,8 @@ Execute (ALEInfoToFile should write to a file correctly):
call ale#linter#Define('testft', g:testlinter1)
call ale#linter#Define('testft2', g:testlinter2)
- execute 'ALEInfoToFile ' . fnameescape(g:dir . '/ale-info-test-file')
+ let g:info_test_file = tempname()
+ execute 'ALEInfoToFile ' . fnameescape(g:info_test_file)
AssertEqual
\ [
@@ -364,7 +365,7 @@ Execute (ALEInfoToFile should write to a file correctly):
\ ]
\ + g:globals_lines
\ + g:command_header,
- \ readfile(g:dir . '/ale-info-test-file')
+ \ readfile(g:info_test_file)
Given testft.testft2 (Empty buffer with two filetypes):
Execute (ALEInfo should buffer-local linter variables):