From ea551044ea8a0de8e2f6937c9d083cecd2f67b99 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Sat, 25 Jul 2015 18:08:25 -0300 Subject: Add the . and .. entries to glob() os_scandir() and os_scandir_next() skip over those, because of the unverlying libuv funcitons behaviour. Fixes #2954 --- test/functional/eval/glob_spec.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/functional/eval/glob_spec.lua (limited to 'test') diff --git a/test/functional/eval/glob_spec.lua b/test/functional/eval/glob_spec.lua new file mode 100644 index 0000000000..977b82d733 --- /dev/null +++ b/test/functional/eval/glob_spec.lua @@ -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) -- cgit