aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-03-12 00:25:55 +0300
committerZyX <kp-pav@yandex.ru>2017-03-12 00:25:55 +0300
commit9d1b439fb7c146d9754c0893750effa03b46d6df (patch)
treec4be6e8098ed740dc57eed281618308273cef817
parent8ef6cfa6ac4e15ab8296098e875bed4353396bb1 (diff)
downloadrneovim-9d1b439fb7c146d9754c0893750effa03b46d6df.tar.gz
rneovim-9d1b439fb7c146d9754c0893750effa03b46d6df.tar.bz2
rneovim-9d1b439fb7c146d9754c0893750effa03b46d6df.zip
tests: Allow lfs.attributes to be NULL when traversing FS
-rw-r--r--test/helpers.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/helpers.lua b/test/helpers.lua
index d3dca00385..e5224349c2 100644
--- a/test/helpers.lua
+++ b/test/helpers.lua
@@ -30,13 +30,15 @@ local function glob(initial_path, re, exc_re)
if ((not exc_re or not checked_path:match(exc_re))
and e:sub(1, 1) ~= '.') then
local attrs = lfs.attributes(full_path)
- local check_key = attrs.dev .. ':' .. tostring(attrs.ino)
- if not checked_files[check_key] then
- checked_files[check_key] = true
- if attrs.mode == 'directory' then
- paths_to_check[#paths_to_check + 1] = full_path
- elseif not re or checked_path:match(re) then
- ret[#ret + 1] = full_path
+ if attrs then
+ local check_key = attrs.dev .. ':' .. tostring(attrs.ino)
+ if not checked_files[check_key] then
+ checked_files[check_key] = true
+ if attrs.mode == 'directory' then
+ paths_to_check[#paths_to_check + 1] = full_path
+ elseif not re or checked_path:match(re) then
+ ret[#ret + 1] = full_path
+ end
end
end
end