aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-06-07 01:57:04 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-06-07 01:57:04 -0400
commitd9660184665a3e3bac5feecb4b4b5680012329d4 (patch)
treefeabcbb1df1390db22c08e9ae816c0533a16862e /test
parent999590b313ef32ca29c4ddba20c5b719730ee7ff (diff)
parent704b58e54abd1adaaa83f00dae7fdb0f385b428b (diff)
downloadrneovim-d9660184665a3e3bac5feecb4b4b5680012329d4.tar.gz
rneovim-d9660184665a3e3bac5feecb4b4b5680012329d4.tar.bz2
rneovim-d9660184665a3e3bac5feecb4b4b5680012329d4.zip
Merge #4878 'build: always regenerate help tags'
Diffstat (limited to 'test')
-rw-r--r--test/functional/helpers.lua16
-rw-r--r--test/functional/legacy/expand_spec.lua7
2 files changed, 19 insertions, 4 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 37b7bf664c..846ce72e14 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -345,10 +345,18 @@ local function rmdir(path)
end
for file in lfs.dir(path) do
if file ~= '.' and file ~= '..' then
- local ret, err = os.remove(path..'/'..file)
- if not ret then
- error('os.remove: '..err)
- return nil
+ local abspath = path..'/'..file
+ if lfs.attributes(abspath, 'mode') == 'directory' then
+ local ret = rmdir(abspath) -- recurse
+ if not ret then
+ return nil
+ end
+ else
+ local ret, err = os.remove(abspath)
+ if not ret then
+ error('os.remove: '..err)
+ return nil
+ end
end
end
end
diff --git a/test/functional/legacy/expand_spec.lua b/test/functional/legacy/expand_spec.lua
index 04701e8ba6..3da1416885 100644
--- a/test/functional/legacy/expand_spec.lua
+++ b/test/functional/legacy/expand_spec.lua
@@ -12,6 +12,13 @@ local function expected_empty()
end
describe('expand file name', function()
+ after_each(function()
+ helpers.rmdir('Xdir1')
+ helpers.rmdir('Xdir2')
+ helpers.rmdir('Xdir3')
+ helpers.rmdir('Xdir4')
+ end)
+
before_each(function()
clear()