From 87a11d65ee576d965bcf432e878f191512e46bdd Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Tue, 3 Nov 2020 11:24:27 -0500 Subject: Fixed `lfs.walk()` bug with root directory. Prevent dir to walk from becoming an empty string. --- test/test.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/test.lua b/test/test.lua index 53a7cb24..8a768731 100644 --- a/test/test.lua +++ b/test/test.lua @@ -759,6 +759,11 @@ function test_lfs_ext_walk_symlinks() os.execute('rm -r ' .. dir) end +function test_lfs_ext_walk_root() + local filename = lfs.walk('/', nil, 0, true)() + assert(not filename:find('lfs_ext.lua:'), 'coroutine error') +end + function test_lfs_ext_abs_path() assert_equal(lfs.abspath('bar', '/foo'), '/foo/bar') assert_equal(lfs.abspath('./bar', '/foo'), '/foo/bar') -- cgit v1.2.3