diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
commit | 9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch) | |
tree | 607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /test/functional/provider | |
parent | 9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff) | |
parent | 3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff) | |
download | rneovim-usermarks.tar.gz rneovim-usermarks.tar.bz2 rneovim-usermarks.zip |
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'test/functional/provider')
-rw-r--r-- | test/functional/provider/clipboard_spec.lua | 64 | ||||
-rw-r--r-- | test/functional/provider/perl_spec.lua | 6 |
2 files changed, 58 insertions, 12 deletions
diff --git a/test/functional/provider/clipboard_spec.lua b/test/functional/provider/clipboard_spec.lua index fbaef3ae00..2c5185a974 100644 --- a/test/functional/provider/clipboard_spec.lua +++ b/test/functional/provider/clipboard_spec.lua @@ -106,8 +106,53 @@ describe('clipboard', function() basic_register_test() end) - it('`:redir @+>` with invalid g:clipboard shows exactly one error #7184', - function() + it('using "+ in Normal mode with invalid g:clipboard always shows error', function() + insert('a') + command("let g:clipboard = 'bogus'") + feed('"+yl') + screen:expect([[ + ^a | + {0:~ }| + {0:~ }| + clipboard: No provider. Try ":checkhealth" or ":h clipboard". | + ]]) + feed('"+p') + screen:expect([[ + a^a | + {0:~ }| + {0:~ }| + clipboard: No provider. Try ":checkhealth" or ":h clipboard". | + ]]) + end) + + it('using clipboard=unnamedplus with invalid g:clipboard shows error once', function() + insert('a') + command("let g:clipboard = 'bogus'") + command('set clipboard=unnamedplus') + feed('yl') + screen:expect([[ + ^a | + {0:~ }| + {0:~ }| + clipboard: No provider. Try ":checkhealth" or ":h clipboard". | + ]]) + feed(':<CR>') + screen:expect([[ + ^a | + {0:~ }| + {0:~ }| + : | + ]]) + feed('p') + screen:expect([[ + a^a | + {0:~ }| + {0:~ }| + : | + ]]) + end) + + it('`:redir @+>` with invalid g:clipboard shows exactly one error #7184', function() command("let g:clipboard = 'bogus'") feed_command('redir @+> | :silent echo system("cat CONTRIBUTING.md") | redir END') screen:expect([[ @@ -118,8 +163,7 @@ describe('clipboard', function() ]]) end) - it('`:redir @+>|bogus_cmd|redir END` + invalid g:clipboard must not recurse #7184', - function() + it('`:redir @+>|bogus_cmd|redir END` + invalid g:clipboard must not recurse #7184', function() command("let g:clipboard = 'bogus'") feed_command('redir @+> | bogus_cmd | redir END') screen:expect{grid=[[ @@ -310,18 +354,18 @@ describe('clipboard (with fake clipboard.vim)', function() insert([[ text: first line - secound line + second line third line]]) feed('G"+dd"*dddd"+p"*pp') expect([[ text: third line - secound line + second line first line]]) -- linewise selection should be encoded as an extra newline eq({{'third line', ''}, 'V'}, eval("g:test_clip['+']")) - eq({{'secound line', ''}, 'V'}, eval("g:test_clip['*']")) + eq({{'second line', ''}, 'V'}, eval("g:test_clip['*']")) end) it('handles null bytes when pasting and in getreg', function() @@ -477,7 +521,7 @@ describe('clipboard (with fake clipboard.vim)', function() expect("indeed star") end) - it('unamed operations work even if the provider fails', function() + it('unnamed operations work even if the provider fails', function() insert('the text') feed('yy') feed_command("let g:cliperror = 1") @@ -511,7 +555,7 @@ describe('clipboard (with fake clipboard.vim)', function() eq('textstar', meths.get_current_line()) end) - it('Block paste works currectly', function() + it('Block paste works correctly', function() insert([[ aabbcc ddeeff @@ -559,7 +603,7 @@ describe('clipboard (with fake clipboard.vim)', function() eq({{'really unnamed', ''}, 'V'}, eval("g:test_clip['+']")) eq({{'really unnamed', ''}, 'V'}, eval("g:test_clip['*']")) - -- unnamedplus takes predecence when pasting + -- unnamedplus takes precedence when pasting eq('+', eval('v:register')) feed_command("let g:test_clip['+'] = ['the plus','']") feed_command("let g:test_clip['*'] = ['the star','']") diff --git a/test/functional/provider/perl_spec.lua b/test/functional/provider/perl_spec.lua index aff5e36e24..ce92831f4c 100644 --- a/test/functional/provider/perl_spec.lua +++ b/test/functional/provider/perl_spec.lua @@ -9,6 +9,8 @@ local curbufmeths = helpers.curbufmeths local insert = helpers.insert local expect = helpers.expect local feed = helpers.feed +local is_os = helpers.is_os +local skip = helpers.skip do clear() @@ -24,7 +26,7 @@ before_each(function() end) describe('legacy perl provider', function() - if helpers.pending_win32(pending) then return end + skip(is_os('win')) it('feature test', function() eq(1, eval('has("perl")')) @@ -68,7 +70,7 @@ describe('legacy perl provider', function() end) describe('perl provider', function() - if helpers.pending_win32(pending) then return end + skip(is_os('win')) teardown(function () os.remove('Xtest-perl-hello.pl') os.remove('Xtest-perl-hello-plugin.pl') |