Stop a test from failing randomly

This commit is contained in:
w0rp 2019-05-21 14:01:58 +01:00
parent 3e3801e81e
commit f6ae056d02
No known key found for this signature in database
GPG key ID: 0FC1ECAA8C81CD83

View file

@ -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):