aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/096_location_list_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-01 03:12:37 +0100
committerGitHub <noreply@github.com>2018-02-01 03:12:37 +0100
commitf8010ea3eca77961312afeb96234678447ce17e4 (patch)
treed9603329fd3320df04f11576d6152491042e9af0 /test/functional/legacy/096_location_list_spec.lua
parent648fed975eb8ddde9c5cbc0f859d06deebf80dd9 (diff)
downloadrneovim-f8010ea3eca77961312afeb96234678447ce17e4.tar.gz
rneovim-f8010ea3eca77961312afeb96234678447ce17e4.tar.bz2
rneovim-f8010ea3eca77961312afeb96234678447ce17e4.zip
test: robust cleanup, unique filenames #7950 (#7950)
Use unique filenames to avoid test conflicts. Use read_file() instead of io.popen(), to ensures the file is closed. Use helpers.rmdir(), it is far more robust than lfs. closes #7911
Diffstat (limited to 'test/functional/legacy/096_location_list_spec.lua')
-rw-r--r--test/functional/legacy/096_location_list_spec.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/functional/legacy/096_location_list_spec.lua b/test/functional/legacy/096_location_list_spec.lua
index 85c4fe0ec4..b21a2085f6 100644
--- a/test/functional/legacy/096_location_list_spec.lua
+++ b/test/functional/legacy/096_location_list_spec.lua
@@ -11,10 +11,10 @@ local source = helpers.source
local clear, command, expect = helpers.clear, helpers.command, helpers.expect
describe('location list', function()
+ local test_file = 'Xtest-096_location_list.out'
setup(clear)
-
teardown(function()
- os.remove('test.out')
+ os.remove(test_file)
end)
it('is working', function()
@@ -70,9 +70,9 @@ describe('location list', function()
endfor
]])
- -- Set up the result buffer "test.out".
+ -- Set up the result buffer.
command('enew')
- command('w! test.out')
+ command('w! '..test_file)
command('b 1')
-- Test A.
@@ -99,7 +99,7 @@ describe('location list', function()
command([[let locationListFileName = substitute(getline(line('.')), '\([^|]*\)|.*', '\1', '')]])
command('wincmd n')
command('wincmd K')
- command('b test.out')
+ command('b '..test_file)
-- Prepare test output and write it to the result buffer.
command([[let fileName = substitute(fileName, '\\', '/', 'g')]])
@@ -132,7 +132,7 @@ describe('location list', function()
command('let numberOfWindowsOpen = winnr("$")')
command('wincmd n')
command('wincmd K')
- command('b test.out')
+ command('b '..test_file)
-- Prepare test output and write it to the result buffer.
command('call append(line("$"), "Test B:")')
@@ -170,7 +170,7 @@ describe('location list', function()
command('let bufferName = expand("%")')
command('wincmd n')
command('wincmd K')
- command('b test.out')
+ command('b '..test_file)
-- Prepare test output and write it to the result buffer.
command([[let bufferName = substitute(bufferName, '\\', '/', 'g')]])