aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-07-04 15:18:18 +0200
committerGitHub <noreply@github.com>2017-07-04 15:18:18 +0200
commit5214798cfcea31c286f20978230746e49af73e37 (patch)
treee795b58ad03cfa784d0418b184fd3d4e6c26bab3 /test/functional/helpers.lua
parent008b604bacbbeeaf0e04f94b1d331b11ebec631a (diff)
parent2208b64891d57a4ab79143183888149be9ee228d (diff)
downloadrneovim-5214798cfcea31c286f20978230746e49af73e37.tar.gz
rneovim-5214798cfcea31c286f20978230746e49af73e37.tar.bz2
rneovim-5214798cfcea31c286f20978230746e49af73e37.zip
Merge #6955 'Fix invalid :echo output'
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 4a170d993b..d7858cacd5 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -337,11 +337,23 @@ local function read_file(name)
return ret
end
+local sourced_fnames = {}
local function source(code)
local fname = tmpname()
write_file(fname, code)
nvim_command('source '..fname)
- os.remove(fname)
+ -- DO NOT REMOVE FILE HERE.
+ -- do_source() has a habit of checking whether files are “same” by using inode
+ -- and device IDs. If you run two source() calls in quick succession there is
+ -- a good chance that underlying filesystem will reuse the inode, making files
+ -- appear as “symlinks” to do_source when it checks FileIDs. With current
+ -- setup linux machines (both QB, travis and mine(ZyX-I) with XFS) do reuse
+ -- inodes, Mac OS machines (again, both QB and travis) do not.
+ --
+ -- Files appearing as “symlinks” mean that both the first and the second
+ -- source() calls will use same SID, which may fail some tests which check for
+ -- exact numbers after `<SNR>` in e.g. function names.
+ sourced_fnames[#sourced_fnames + 1] = fname
return fname
end
@@ -673,6 +685,9 @@ local module = {
return function(after_each)
if after_each then
after_each(function()
+ for _, fname in ipairs(sourced_fnames) do
+ os.remove(fname)
+ end
check_logs()
check_cores('build/bin/nvim')
end)