aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval
diff options
context:
space:
mode:
authorFelipe Morales <hel.sheep@gmail.com>2015-07-25 18:08:25 -0300
committerJustin M. Keyes <justinkz@gmail.com>2015-08-01 23:16:17 -0400
commitea551044ea8a0de8e2f6937c9d083cecd2f67b99 (patch)
tree22fb3ae8dd192f9dc50053b02d33e76af73a6af1 /test/functional/eval
parent746a4e9f847242f0168453a6b85431561f670f32 (diff)
downloadrneovim-ea551044ea8a0de8e2f6937c9d083cecd2f67b99.tar.gz
rneovim-ea551044ea8a0de8e2f6937c9d083cecd2f67b99.tar.bz2
rneovim-ea551044ea8a0de8e2f6937c9d083cecd2f67b99.zip
Add the . and .. entries to glob()
os_scandir() and os_scandir_next() skip over those, because of the unverlying libuv funcitons behaviour. Fixes #2954
Diffstat (limited to 'test/functional/eval')
-rw-r--r--test/functional/eval/glob_spec.lua21
1 files changed, 21 insertions, 0 deletions
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)