aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2015-03-25 18:21:02 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2015-04-05 11:34:13 +0200
commit638ceea092f01675e964a5e5a6adc6af8f28f423 (patch)
tree721fef7bc3ed5093c14dd0854e72a7f6ef0340e4
parent73bf0551f891a13d76f436bf6a26933089539fa9 (diff)
downloadrneovim-638ceea092f01675e964a5e5a6adc6af8f28f423.tar.gz
rneovim-638ceea092f01675e964a5e5a6adc6af8f28f423.tar.bz2
rneovim-638ceea092f01675e964a5e5a6adc6af8f28f423.zip
test/clipboard: split unrelated subtests
-rw-r--r--test/functional/clipboard/clipboard_provider_spec.lua31
1 files changed, 16 insertions, 15 deletions
diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua
index 1a798ec48c..c5577327f9 100644
--- a/test/functional/clipboard/clipboard_provider_spec.lua
+++ b/test/functional/clipboard/clipboard_provider_spec.lua
@@ -8,6 +8,7 @@ local nvim, run, stop, restart = helpers.nvim, helpers.run, helpers.stop, helper
local function reset()
clear()
execute('let &rtp = "test/functional/clipboard,".&rtp')
+ execute('call getreg("*")') -- force load of provider
end
local function basic_register_test()
@@ -62,7 +63,8 @@ local function basic_register_test()
end
describe('clipboard usage', function()
- setup(reset)
+ before_each(reset)
+
it("works", function()
basic_register_test()
@@ -71,9 +73,9 @@ describe('clipboard usage', function()
feed('^"*dwdw"*P')
expect('some ')
eq({'some '}, eval("g:test_clip['*']"))
- reset()
+ end)
- -- "* and "+ should be independent when the provider supports it
+ it('supports separate "* and "+ when the provider supports it', function()
insert([[
text:
first line
@@ -89,9 +91,9 @@ describe('clipboard usage', function()
-- linewise selection should be encoded as an extra newline
eq({'third line', ''}, eval("g:test_clip['+']"))
eq({'secound line', ''}, eval("g:test_clip['*']"))
- reset()
+ end)
- -- handle null bytes
+ it('handles null bytes', function()
insert("some\022000text\n\022000very binary\022000")
feed('"*y-+"*p')
eq({'some\ntext', '\nvery binary\n',''}, eval("g:test_clip['*']"))
@@ -100,22 +102,21 @@ describe('clipboard usage', function()
-- test getreg/getregtype
eq('some\ntext\n\nvery binary\n\n', eval("getreg('*', 1)"))
eq("V", eval("getregtype('*')"))
- reset()
+ end)
- -- blockwise paste
+ it('support blockwise operations', function()
insert([[
much
text]])
- feed('"*yy') -- force load of provider
execute("let g:test_clip['*'] = [['very','block'],'b']")
feed('gg"*P')
expect([[
very much
blocktext]])
eq("\0225", eval("getregtype('*')"))
- reset()
+ end)
- -- test setreg
+ it('supports setreg', function()
execute('call setreg("*", "setted\\ntext", "c")')
execute('call setreg("+", "explicitly\\nlines", "l")')
feed('"+P"*p')
@@ -124,9 +125,9 @@ describe('clipboard usage', function()
textxplicitly
lines
]])
- reset()
+ end)
- -- test let @+ (issue #1427)
+ it('supports let @+ (issue #1427)', function()
execute("let @+ = 'some'")
execute("let @* = ' other stuff'")
eq({'some'}, eval("g:test_clip['+']"))
@@ -136,8 +137,9 @@ describe('clipboard usage', function()
execute("let @+ .= ' more'")
feed('dd"+p')
expect('some more')
- reset()
+ end)
+ it('supports clipboard=unnamed', function()
-- the basic behavior of unnamed register should be the same
-- even when handled by clipboard provider
execute('set clipboard=unnamed')
@@ -155,7 +157,6 @@ describe('clipboard usage', function()
expect([[
words
linewise stuff]])
- reset()
+ end)
- end)
end)