mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test(unit): use file:close() properly (#21505)
This commit is contained in:
parent
843ad837c6
commit
b2d984558b
@ -28,9 +28,9 @@ describe('buffer functions', function()
|
||||
|
||||
setup(function()
|
||||
-- create the files
|
||||
io.open(path1, 'w').close()
|
||||
io.open(path2, 'w').close()
|
||||
io.open(path3, 'w').close()
|
||||
io.open(path1, 'w'):close()
|
||||
io.open(path2, 'w'):close()
|
||||
io.open(path3, 'w'):close()
|
||||
end)
|
||||
|
||||
teardown(function()
|
||||
|
@ -72,9 +72,9 @@ describe('fs.c', function()
|
||||
before_each(function()
|
||||
lfs.mkdir('unit-test-directory');
|
||||
|
||||
io.open('unit-test-directory/test.file', 'w').close()
|
||||
io.open('unit-test-directory/test.file', 'w'):close()
|
||||
|
||||
io.open('unit-test-directory/test_2.file', 'w').close()
|
||||
io.open('unit-test-directory/test_2.file', 'w'):close()
|
||||
lfs.link('test.file', 'unit-test-directory/test_link.file', true)
|
||||
|
||||
lfs.link('non_existing_file.file', 'unit-test-directory/test_broken_link.file', true)
|
||||
@ -472,7 +472,7 @@ describe('fs.c', function()
|
||||
|
||||
describe('os_remove', function()
|
||||
before_each(function()
|
||||
io.open('unit-test-directory/test_remove.file', 'w').close()
|
||||
io.open('unit-test-directory/test_remove.file', 'w'):close()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
|
@ -82,8 +82,8 @@ describe('path.c', function()
|
||||
local f2 = 'f2.o'
|
||||
before_each(function()
|
||||
-- create the three files that will be used in this spec
|
||||
io.open(f1, 'w').close()
|
||||
io.open(f2, 'w').close()
|
||||
io.open(f1, 'w'):close()
|
||||
io.open(f2, 'w'):close()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
@ -355,7 +355,7 @@ end)
|
||||
describe('path.c', function()
|
||||
setup(function()
|
||||
lfs.mkdir('unit-test-directory');
|
||||
io.open('unit-test-directory/test.file', 'w').close()
|
||||
io.open('unit-test-directory/test.file', 'w'):close()
|
||||
|
||||
-- Since the tests are executed, they are called by an executable. We use
|
||||
-- that executable for several asserts.
|
||||
|
Loading…
Reference in New Issue
Block a user