diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-03-06 10:50:22 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-03-06 12:40:22 +0100 |
commit | d1d35c9cfcc7a3e92c4bd7d931b96ab0a06cfb90 (patch) | |
tree | 9df6b1fc747c6c972849949f85bd9e1113fa52dc /test/functional/eval/backtick_expansion_spec.lua | |
parent | 60fa3aa14350805f79e078bfbad4ed1232e9c5aa (diff) | |
download | rneovim-d1d35c9cfcc7a3e92c4bd7d931b96ab0a06cfb90.tar.gz rneovim-d1d35c9cfcc7a3e92c4bd7d931b96ab0a06cfb90.tar.bz2 rneovim-d1d35c9cfcc7a3e92c4bd7d931b96ab0a06cfb90.zip |
test: backtick expansion #6218
Diffstat (limited to 'test/functional/eval/backtick_expansion_spec.lua')
-rw-r--r-- | test/functional/eval/backtick_expansion_spec.lua | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/functional/eval/backtick_expansion_spec.lua b/test/functional/eval/backtick_expansion_spec.lua new file mode 100644 index 0000000000..81e8e295fa --- /dev/null +++ b/test/functional/eval/backtick_expansion_spec.lua @@ -0,0 +1,42 @@ +local lfs = require('lfs') +local helpers = require('test.functional.helpers')(after_each) +local clear, command, eval, eq = helpers.clear, helpers.command, helpers.eval, helpers.eq +local write_file = helpers.write_file + +describe("backtick expansion", function() + setup(function() + clear() + lfs.mkdir("test-backticks") + write_file("test-backticks/file1", "test file 1") + write_file("test-backticks/file2", "test file 2") + write_file("test-backticks/file3", "test file 3") + lfs.mkdir("test-backticks/subdir") + write_file("test-backticks/subdir/file4", "test file 4") + -- Long path might cause "Press ENTER" prompt; use :silent to avoid it. + command('silent cd test-backticks') + end) + + teardown(function() + helpers.rmdir('test-backticks') + end) + + it("with default 'shell'", function() + if helpers.pending_win32(pending) then return end -- Need win32 shell fixes + command(":silent args `echo ***2`") + eq({ "file2", }, eval("argv()")) + command(":silent args `echo */*4`") + eq({ "subdir/file4", }, eval("argv()")) + end) + + it("with shell=fish", function() + if eval("executable('fish')") == 0 then + pending('missing "fish" command') + return + end + command("set shell=fish") + command(":silent args `echo ***2`") + eq({ "file2", }, eval("argv()")) + command(":silent args `echo */*4`") + eq({ "subdir/file4", }, eval("argv()")) + end) +end) |