Add the . and .. entries to glob()

os_scandir() and os_scandir_next() skip over those, because of the
unverlying libuv funcitons behaviour.

Fixes #2954
This commit is contained in:
Felipe Morales
2015-07-25 18:08:25 -03:00
committed by Justin M. Keyes
parent 746a4e9f84
commit ea551044ea
2 changed files with 47 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
local helpers = require('test.functional.helpers')
local clear, execute, eval, eq = helpers.clear, helpers.execute, helpers.eval, helpers.eq
before_each(function()
clear()
lfs.mkdir('test-glob')
execute('cd test-glob')
end)
after_each(function()
lfs.rmdir('test-glob')
end)
describe('glob()', function()
it("glob('.*') returns . and .. ", function()
eq({'.', '..'}, eval("glob('.*', 0, 1)"))
end)
it("glob('*') returns an empty list ", function()
eq({}, eval("glob('*', 0, 1)"))
end)
end)