diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/fixtures/printargs-test.c | 3 | ||||
-rw-r--r-- | test/functional/fixtures/shell-test.c | 3 | ||||
-rw-r--r-- | test/functional/fixtures/tty-test.c | 3 | ||||
-rw-r--r-- | test/functional/insert/ctrl_r_spec.lua | 19 | ||||
-rw-r--r-- | test/functional/normal/fold_spec.lua | 19 | ||||
-rw-r--r-- | test/functional/terminal/scrollback_spec.lua | 7 | ||||
-rw-r--r-- | test/functional/ui/highlight_spec.lua | 45 | ||||
-rw-r--r-- | test/unit/fixtures/multiqueue.c | 3 | ||||
-rw-r--r-- | test/unit/fixtures/rbuffer.c | 3 |
9 files changed, 85 insertions, 20 deletions
diff --git a/test/functional/fixtures/printargs-test.c b/test/functional/fixtures/printargs-test.c index 2c25cf8447..be54605817 100644 --- a/test/functional/fixtures/printargs-test.c +++ b/test/functional/fixtures/printargs-test.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include <stdio.h> int main(int argc, char **argv) diff --git a/test/functional/fixtures/shell-test.c b/test/functional/fixtures/shell-test.c index 3f3976ece5..8dbec2aaee 100644 --- a/test/functional/fixtures/shell-test.c +++ b/test/functional/fixtures/shell-test.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include <stdio.h> #include <string.h> #include <stdint.h> diff --git a/test/functional/fixtures/tty-test.c b/test/functional/fixtures/tty-test.c index 778e7f3cd3..3406b3a202 100644 --- a/test/functional/fixtures/tty-test.c +++ b/test/functional/fixtures/tty-test.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include <stdbool.h> #include <stdio.h> #include <stdlib.h> diff --git a/test/functional/insert/ctrl_r_spec.lua b/test/functional/insert/ctrl_r_spec.lua new file mode 100644 index 0000000000..adc3c4b406 --- /dev/null +++ b/test/functional/insert/ctrl_r_spec.lua @@ -0,0 +1,19 @@ +local helpers = require('test.functional.helpers')(after_each) +local clear, feed = helpers.clear, helpers.feed +local expect, command = helpers.expect, helpers.command + +describe('insert-mode Ctrl-R', function() + before_each(clear) + + it('works', function() + command("let @@ = 'test'") + feed('i<C-r>"') + expect('test') + end) + + it('works with multi-byte text', function() + command("let @@ = 'påskägg'") + feed('i<C-r>"') + expect('påskägg') + end) +end) diff --git a/test/functional/normal/fold_spec.lua b/test/functional/normal/fold_spec.lua index 85e4631b61..00e83bedc8 100644 --- a/test/functional/normal/fold_spec.lua +++ b/test/functional/normal/fold_spec.lua @@ -232,6 +232,25 @@ a a]], '2,3m0') eq({1, 2, 0, 0, 0}, get_folds()) end) + it('handles shifting all remaining folds', function() + test_move_indent([[ + a + a + a + a + a + a + a + a + a + a + a + a + a + a +a]], '13m7') + eq({1, 2, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 2, 1, 0}, get_folds()) + end) end) it('updates correctly on :read', function() -- luacheck: ignore 621 diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua index 32f25d4086..05f81295c2 100644 --- a/test/functional/terminal/scrollback_spec.lua +++ b/test/functional/terminal/scrollback_spec.lua @@ -451,6 +451,13 @@ describe("'scrollback' option", function() it(':setlocal in a normal buffer is an error', function() command('new') + + -- :setlocal to -1 is NOT an error. + feed_command('setlocal scrollback=-1') + eq(nil, string.match(eval("v:errmsg"), "E%d*:")) + feed('<CR>') + + -- :setlocal to anything except -1 is an error. feed_command('setlocal scrollback=42') feed('<CR>') eq('E474:', string.match(eval("v:errmsg"), "E%d*:")) diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 5f8fafef07..2bda907c33 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -2,23 +2,23 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local os = require('os') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert +local command = helpers.command +local eval = helpers.eval local feed_command, request, eq = helpers.feed_command, helpers.request, helpers.eq -if helpers.pending_win32(pending) then return end - -describe('color scheme compatibility', function() +describe('colorscheme compatibility', function() before_each(function() clear() end) it('t_Co is set to 256 by default', function() - eq('256', request('vim_eval', '&t_Co')) + eq('256', eval('&t_Co')) request('nvim_set_option', 't_Co', '88') - eq('88', request('vim_eval', '&t_Co')) + eq('88', eval('&t_Co')) end) end) -describe('manual syntax highlight', function() +describe('highlight: `:syntax manual`', function() -- When using manual syntax highlighting, it should be preserved even when -- switching buffers... bug did only occur without :set hidden -- Ref: vim patch 7.4.1236 @@ -63,32 +63,32 @@ describe('manual syntax highlight', function() end) it("works with buffer switch and 'nohidden'", function() - feed_command('e tmp1.vim') - feed_command('e Xtest-functional-ui-highlight.tmp.vim') - feed_command('filetype on') - feed_command('syntax manual') - feed_command('set ft=vim') - feed_command('set syntax=ON') + command('e tmp1.vim') + command('e Xtest-functional-ui-highlight.tmp.vim') + command('filetype on') + command('syntax manual') + command('set filetype=vim fileformat=unix') + command('set syntax=ON') feed('iecho 1<esc>0') - feed_command('set nohidden') - feed_command('w') - feed_command('bn') - feed_command('bp') + command('set nohidden') + command('w') + command('silent bn') + eq("tmp1.vim", eval("fnamemodify(bufname('%'), ':t')")) + feed_command('silent bp') + eq("Xtest-functional-ui-highlight.tmp.vim", eval("fnamemodify(bufname('%'), ':t')")) screen:expect([[ {1:^echo} 1 | {0:~ }| {0:~ }| {0:~ }| - <ht.tmp.vim" 1L, 7C | + :silent bp | ]]) end) end) -describe('Default highlight groups', function() - -- Test the default attributes for highlight groups shown by the :highlight - -- command +describe('highlight defaults', function() local screen before_each(function() @@ -281,6 +281,11 @@ describe('Default highlight groups', function() ]], {[0] = {bold=true, foreground=Screen.colors.Blue}}) end) + it('Cursor after `:hi clear|syntax reset` #6508', function() + command('highlight clear|syntax reset') + eq('guifg=bg guibg=fg', eval([[matchstr(execute('hi Cursor'), '\v(gui|cterm).*$')]])) + end) + it('Whitespace highlight', function() screen:try_resize(53, 4) feed_command('highlight NonText gui=NONE guifg=#FF0000') diff --git a/test/unit/fixtures/multiqueue.c b/test/unit/fixtures/multiqueue.c index da63e55919..a8dca0a844 100644 --- a/test/unit/fixtures/multiqueue.c +++ b/test/unit/fixtures/multiqueue.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include <string.h> #include <stdlib.h> #include "nvim/event/multiqueue.h" diff --git a/test/unit/fixtures/rbuffer.c b/test/unit/fixtures/rbuffer.c index d587d6b054..3f4062fa18 100644 --- a/test/unit/fixtures/rbuffer.c +++ b/test/unit/fixtures/rbuffer.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include "nvim/rbuffer.h" #include "rbuffer.h" |