aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shell/viml_system_spec.lua
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-10-23 22:19:18 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-10-23 22:19:18 -0300
commit65942d3a8d84510fcee2dd1c6306a5af13296c84 (patch)
treecbb3ce006567835f4ed64582cfa4c0181bd2d7bb /test/functional/shell/viml_system_spec.lua
parentd1e063a8af57661c37da31954346b2b9f73dd9b5 (diff)
parentd696fa51f8a295942da8952d7f85c44b9afac67e (diff)
downloadrneovim-65942d3a8d84510fcee2dd1c6306a5af13296c84.tar.gz
rneovim-65942d3a8d84510fcee2dd1c6306a5af13296c84.tar.bz2
rneovim-65942d3a8d84510fcee2dd1c6306a5af13296c84.zip
Merge PR #1331 'Fixes to job and channel modules'
Diffstat (limited to 'test/functional/shell/viml_system_spec.lua')
-rw-r--r--test/functional/shell/viml_system_spec.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/functional/shell/viml_system_spec.lua b/test/functional/shell/viml_system_spec.lua
index 6dde2ef538..9ed1016f73 100644
--- a/test/functional/shell/viml_system_spec.lua
+++ b/test/functional/shell/viml_system_spec.lua
@@ -19,6 +19,15 @@ local function delete_file(name)
end
end
+-- Some tests require the xclip program and a x server.
+local xclip = nil
+do
+ if os.getenv('DISPLAY') then
+ local proc = io.popen('which xclip')
+ xclip = proc:read()
+ proc:close()
+ end
+end
describe('system()', function()
before_each(clear)
@@ -85,6 +94,15 @@ describe('system()', function()
end)
end)
end)
+
+ if xclip then
+ describe("with a program that doesn't close stdout", function()
+ it('will exit properly after passing input', function()
+ eq(nil, eval([[system('xclip -i -selection clipboard', 'clip-data')]]))
+ eq('clip-data', eval([[system('xclip -o -selection clipboard')]]))
+ end)
+ end)
+ end
end)
describe('systemlist()', function()
@@ -140,4 +158,15 @@ describe('systemlist()', function()
end)
end)
end)
+
+ if xclip then
+ describe("with a program that doesn't close stdout", function()
+ it('will exit properly after passing input', function()
+ eq(nil, eval(
+ "systemlist('xclip -i -selection clipboard', ['clip', 'data'])"))
+ eq({'clip', 'data'}, eval(
+ "systemlist('xclip -o -selection clipboard')"))
+ end)
+ end)
+ end
end)