test: Use clipboard fixture instead of user's clipboard (#4903)

This commit is contained in:
James McCoy
2016-06-11 12:58:57 -04:00
committed by Justin M. Keyes
parent 871fc6c1e1
commit e7ab3e7e59

View File

@@ -5,11 +5,6 @@ local feed, insert, source = helpers.feed, helpers.insert, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
local eq, eval, write_file = helpers.eq, helpers.eval, helpers.write_file local eq, eval, write_file = helpers.eq, helpers.eval, helpers.write_file
local function has_clipboard()
clear()
return 1 == eval("has('clipboard')")
end
describe('eval', function() describe('eval', function()
setup(function() setup(function()
write_file('test_eval_setup.vim', [[ write_file('test_eval_setup.vim', [[
@@ -539,8 +534,13 @@ describe('eval', function()
=: type v; value: abc/]].."\000 (['abc/\000"..[[']), expr: "abc/]]..'\000'..[[" (['"abc/]]..'\000'..[["'])]]) =: type v; value: abc/]].."\000 (['abc/\000"..[[']), expr: "abc/]]..'\000'..[[" (['"abc/]]..'\000'..[["'])]])
end) end)
if has_clipboard() then describe('system clipboard', function()
it('system clipboard', function() before_each(function()
execute('let &runtimepath = "test/functional/fixtures,".&runtimepath')
execute('call getreg("*")') -- force load of provider
end)
it('works', function()
insert([[ insert([[
Some first line (this text was at the top of the old test_eval.in). Some first line (this text was at the top of the old test_eval.in).
@@ -570,9 +570,7 @@ describe('eval', function()
*: type V; value: clipboard contents]]..'\00'..[[ (['clipboard contents']), expr: clipboard contents]]..'\00'..[[ (['clipboard contents']) *: type V; value: clipboard contents]]..'\00'..[[ (['clipboard contents']), expr: clipboard contents]]..'\00'..[[ (['clipboard contents'])
*: type V; value: something else]]..'\00'..[[ (['something else']), expr: something else]]..'\00'..[[ (['something else'])]]) *: type V; value: something else]]..'\00'..[[ (['something else']), expr: something else]]..'\00'..[[ (['something else'])]])
end) end)
else end)
pending('system clipboard not available', function() end)
end
it('errors', function() it('errors', function()
source([[ source([[