aboutsummaryrefslogtreecommitdiff
path: root/test/functional/fixtures
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /test/functional/fixtures
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-aucmd_textputpost.tar.gz
rneovim-aucmd_textputpost.tar.bz2
rneovim-aucmd_textputpost.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/fixtures')
-rw-r--r--test/functional/fixtures/api_level_11.mpackbin0 -> 31225 bytes
-rw-r--r--test/functional/fixtures/autoload/health/broken.vim3
-rw-r--r--test/functional/fixtures/autoload/health/full_render.vim8
-rw-r--r--test/functional/fixtures/autoload/health/success1.vim6
-rw-r--r--test/functional/fixtures/autoload/health/success2.vim4
-rw-r--r--test/functional/fixtures/fake-lsp-server.lua62
-rw-r--r--test/functional/fixtures/lua/test_plug/autoload/health/test_plug.vim3
-rw-r--r--test/functional/fixtures/lua/test_plug/full_render/health.lua12
-rw-r--r--test/functional/fixtures/lua/test_plug/health/init.lua8
-rw-r--r--test/functional/fixtures/lua/test_plug/submodule/health.lua8
-rw-r--r--test/functional/fixtures/lua/test_plug/submodule_failed/health.lua11
-rw-r--r--test/functional/fixtures/lua/test_plug/success1/health.lua10
-rw-r--r--test/functional/fixtures/lua/test_plug/success2/health.lua8
-rw-r--r--test/functional/fixtures/printargs-test.c3
-rw-r--r--test/functional/fixtures/printenv-test.c3
-rw-r--r--test/functional/fixtures/shell-test.c3
-rw-r--r--test/functional/fixtures/start/nvim-leftpad/lua/async_leftpad.lua2
-rw-r--r--test/functional/fixtures/streams-test.c3
-rw-r--r--test/functional/fixtures/tty-test.c11
-rw-r--r--test/functional/fixtures/wildpum/Xnamedir/XdirA/XdirB/XfileC (renamed from test/functional/fixtures/wildpum/Xdir/XdirA/XdirB/XfileC)0
-rw-r--r--test/functional/fixtures/wildpum/Xnamedir/XdirA/XfileB (renamed from test/functional/fixtures/wildpum/Xdir/XdirA/XfileB)0
-rw-r--r--test/functional/fixtures/wildpum/Xnamedir/XfileA (renamed from test/functional/fixtures/wildpum/Xdir/XfileA)0
22 files changed, 95 insertions, 73 deletions
diff --git a/test/functional/fixtures/api_level_11.mpack b/test/functional/fixtures/api_level_11.mpack
new file mode 100644
index 0000000000..2399854c42
--- /dev/null
+++ b/test/functional/fixtures/api_level_11.mpack
Binary files differ
diff --git a/test/functional/fixtures/autoload/health/broken.vim b/test/functional/fixtures/autoload/health/broken.vim
deleted file mode 100644
index a2a595b96f..0000000000
--- a/test/functional/fixtures/autoload/health/broken.vim
+++ /dev/null
@@ -1,3 +0,0 @@
-function! health#broken#check()
- throw 'caused an error'
-endfunction
diff --git a/test/functional/fixtures/autoload/health/full_render.vim b/test/functional/fixtures/autoload/health/full_render.vim
deleted file mode 100644
index 2064b8606e..0000000000
--- a/test/functional/fixtures/autoload/health/full_render.vim
+++ /dev/null
@@ -1,8 +0,0 @@
-function! health#full_render#check()
- call health#report_start("report 1")
- call health#report_ok("life is fine")
- call health#report_warn("no what installed", ["pip what", "make what"])
- call health#report_start("report 2")
- call health#report_info("stuff is stable")
- call health#report_error("why no hardcopy", [":h :hardcopy", ":h :TOhtml"])
-endfunction
diff --git a/test/functional/fixtures/autoload/health/success1.vim b/test/functional/fixtures/autoload/health/success1.vim
deleted file mode 100644
index a360347455..0000000000
--- a/test/functional/fixtures/autoload/health/success1.vim
+++ /dev/null
@@ -1,6 +0,0 @@
-function! health#success1#check()
- call health#report_start("report 1")
- call health#report_ok("everything is fine")
- call health#report_start("report 2")
- call health#report_ok("nothing to see here")
-endfunction
diff --git a/test/functional/fixtures/autoload/health/success2.vim b/test/functional/fixtures/autoload/health/success2.vim
deleted file mode 100644
index b742b4879d..0000000000
--- a/test/functional/fixtures/autoload/health/success2.vim
+++ /dev/null
@@ -1,4 +0,0 @@
-function! health#success2#check()
- call health#report_start("another 1")
- call health#report_ok("ok")
-endfunction
diff --git a/test/functional/fixtures/fake-lsp-server.lua b/test/functional/fixtures/fake-lsp-server.lua
index db0c8c0c3f..0db9265a29 100644
--- a/test/functional/fixtures/fake-lsp-server.lua
+++ b/test/functional/fixtures/fake-lsp-server.lua
@@ -272,6 +272,7 @@ function tests.text_document_save_did_open()
end;
body = function()
notify('start')
+ expect_notification('textDocument/didClose')
expect_notification('textDocument/didOpen')
expect_notification('textDocument/didSave')
notify('shutdown')
@@ -787,6 +788,9 @@ function tests.code_action_server_side_command()
codeActionProvider = {
resolveProvider = false,
},
+ executeCommandProvider = {
+ commands = {"dummy1"}
+ },
},
}
end,
@@ -830,21 +834,21 @@ function tests.code_action_filter()
isPreferred = true,
command = 'preferred_command',
}
- local quickfix_action = {
+ local type_annotate_action = {
title = 'Action 3',
- kind = 'quickfix',
- command = 'quickfix_command',
+ kind = 'type-annotate',
+ command = 'type_annotate_command',
}
- local quickfix_foo_action = {
+ local type_annotate_foo_action = {
title = 'Action 4',
- kind = 'quickfix.foo',
- command = 'quickfix_foo_command',
+ kind = 'type-annotate.foo',
+ command = 'type_annotate_foo_command',
}
expect_request('textDocument/codeAction', function()
- return nil, { action, preferred_action, quickfix_action, quickfix_foo_action, }
+ return nil, { action, preferred_action, type_annotate_action, type_annotate_foo_action, }
end)
expect_request('textDocument/codeAction', function()
- return nil, { action, preferred_action, quickfix_action, quickfix_foo_action, }
+ return nil, { action, preferred_action, type_annotate_action, type_annotate_foo_action, }
end)
notify('shutdown')
end;
@@ -927,12 +931,52 @@ function tests.basic_formatting()
}
end
+function tests.set_defaults_all_capabilities()
+ skeleton {
+ on_init = function(_)
+ return {
+ capabilities = {
+ definitionProvider = true,
+ completionProvider = true,
+ documentRangeFormattingProvider = true,
+ hoverProvider = true,
+ }
+ }
+ end;
+ body = function()
+ notify('test')
+ end;
+ }
+end
+
+function tests.inlay_hint()
+ skeleton {
+ on_init = function(params)
+ local expected_capabilities = protocol.make_client_capabilities()
+ assert_eq(params.capabilities, expected_capabilities)
+ return {
+ capabilities = {
+ inlayHintProvider = true;
+ }
+ }
+ end;
+ body = function()
+ notify('start')
+ expect_request('textDocument/inlayHint', function()
+ return nil, {}
+ end)
+ expect_notification("finish")
+ notify('finish')
+ end;
+ }
+end
+
-- Tests will be indexed by test_name
local test_name = arg[1]
local timeout = arg[2]
assert(type(test_name) == 'string', 'test_name must be specified as first arg.')
-local kill_timer = vim.loop.new_timer()
+local kill_timer = vim.uv.new_timer()
kill_timer:start(timeout or 1e3, 0, function()
kill_timer:stop()
kill_timer:close()
diff --git a/test/functional/fixtures/lua/test_plug/autoload/health/test_plug.vim b/test/functional/fixtures/lua/test_plug/autoload/health/test_plug.vim
deleted file mode 100644
index de05f56e9e..0000000000
--- a/test/functional/fixtures/lua/test_plug/autoload/health/test_plug.vim
+++ /dev/null
@@ -1,3 +0,0 @@
-function! health#success1#check()
- call health#report_start("If you see this I'm broken")
-endfunction
diff --git a/test/functional/fixtures/lua/test_plug/full_render/health.lua b/test/functional/fixtures/lua/test_plug/full_render/health.lua
new file mode 100644
index 0000000000..10833f6239
--- /dev/null
+++ b/test/functional/fixtures/lua/test_plug/full_render/health.lua
@@ -0,0 +1,12 @@
+local M = {}
+
+M.check = function()
+ vim.health.start('report 1')
+ vim.health.ok('life is fine')
+ vim.health.warn('no what installed', { 'pip what', 'make what' })
+ vim.health.start('report 2')
+ vim.health.info('stuff is stable')
+ vim.health.error('why no hardcopy', { ':h :hardcopy', ':h :TOhtml' })
+end
+
+return M
diff --git a/test/functional/fixtures/lua/test_plug/health/init.lua b/test/functional/fixtures/lua/test_plug/health/init.lua
index 58162d4515..ef0c5ae3cd 100644
--- a/test/functional/fixtures/lua/test_plug/health/init.lua
+++ b/test/functional/fixtures/lua/test_plug/health/init.lua
@@ -1,10 +1,10 @@
local M = {}
M.check = function()
- vim.health.report_start("report 1")
- vim.health.report_ok("everything is fine")
- vim.health.report_start("report 2")
- vim.health.report_ok("nothing to see here")
+ vim.health.start('report 1')
+ vim.health.ok('everything is fine')
+ vim.health.start('report 2')
+ vim.health.ok('nothing to see here')
end
return M
diff --git a/test/functional/fixtures/lua/test_plug/submodule/health.lua b/test/functional/fixtures/lua/test_plug/submodule/health.lua
index 58162d4515..ef0c5ae3cd 100644
--- a/test/functional/fixtures/lua/test_plug/submodule/health.lua
+++ b/test/functional/fixtures/lua/test_plug/submodule/health.lua
@@ -1,10 +1,10 @@
local M = {}
M.check = function()
- vim.health.report_start("report 1")
- vim.health.report_ok("everything is fine")
- vim.health.report_start("report 2")
- vim.health.report_ok("nothing to see here")
+ vim.health.start('report 1')
+ vim.health.ok('everything is fine')
+ vim.health.start('report 2')
+ vim.health.ok('nothing to see here')
end
return M
diff --git a/test/functional/fixtures/lua/test_plug/submodule_failed/health.lua b/test/functional/fixtures/lua/test_plug/submodule_failed/health.lua
deleted file mode 100644
index ee5f4e404b..0000000000
--- a/test/functional/fixtures/lua/test_plug/submodule_failed/health.lua
+++ /dev/null
@@ -1,11 +0,0 @@
-local M = {}
-
-M.check = function()
- vim.health.report_start("report 1")
- vim.health.report_ok("everything is fine")
- vim.health.report_warn("About to add a number to nil")
- local a = nil + 2
- return a
-end
-
-return M
diff --git a/test/functional/fixtures/lua/test_plug/success1/health.lua b/test/functional/fixtures/lua/test_plug/success1/health.lua
new file mode 100644
index 0000000000..ef0c5ae3cd
--- /dev/null
+++ b/test/functional/fixtures/lua/test_plug/success1/health.lua
@@ -0,0 +1,10 @@
+local M = {}
+
+M.check = function()
+ vim.health.start('report 1')
+ vim.health.ok('everything is fine')
+ vim.health.start('report 2')
+ vim.health.ok('nothing to see here')
+end
+
+return M
diff --git a/test/functional/fixtures/lua/test_plug/success2/health.lua b/test/functional/fixtures/lua/test_plug/success2/health.lua
new file mode 100644
index 0000000000..240a2d33de
--- /dev/null
+++ b/test/functional/fixtures/lua/test_plug/success2/health.lua
@@ -0,0 +1,8 @@
+local M = {}
+
+M.check = function()
+ vim.health.start('another 1')
+ vim.health.ok('ok')
+end
+
+return M
diff --git a/test/functional/fixtures/printargs-test.c b/test/functional/fixtures/printargs-test.c
index be54605817..2c25cf8447 100644
--- a/test/functional/fixtures/printargs-test.c
+++ b/test/functional/fixtures/printargs-test.c
@@ -1,6 +1,3 @@
-// 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/printenv-test.c b/test/functional/fixtures/printenv-test.c
index 295b4f04c3..f826a28db4 100644
--- a/test/functional/fixtures/printenv-test.c
+++ b/test/functional/fixtures/printenv-test.c
@@ -1,6 +1,3 @@
-// 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>
#ifdef MSWIN
diff --git a/test/functional/fixtures/shell-test.c b/test/functional/fixtures/shell-test.c
index 4196716799..ef9f23e3f9 100644
--- a/test/functional/fixtures/shell-test.c
+++ b/test/functional/fixtures/shell-test.c
@@ -1,6 +1,3 @@
-// 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/start/nvim-leftpad/lua/async_leftpad.lua b/test/functional/fixtures/start/nvim-leftpad/lua/async_leftpad.lua
index 45226ce24b..ffbd8a4f83 100644
--- a/test/functional/fixtures/start/nvim-leftpad/lua/async_leftpad.lua
+++ b/test/functional/fixtures/start/nvim-leftpad/lua/async_leftpad.lua
@@ -1,5 +1,5 @@
return function (val, res)
local handle
- handle = vim.loop.new_async(function() _G[res] = require'leftpad'(val) handle:close() end)
+ handle = vim.uv.new_async(function() _G[res] = require'leftpad'(val) handle:close() end)
handle:send()
end
diff --git a/test/functional/fixtures/streams-test.c b/test/functional/fixtures/streams-test.c
index be40edfe7e..5a59abb33b 100644
--- a/test/functional/fixtures/streams-test.c
+++ b/test/functional/fixtures/streams-test.c
@@ -1,6 +1,3 @@
-// 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
-
/// Helper program to exit and keep stdout open (like "xclip -i -loops 1").
#include <stdio.h>
diff --git a/test/functional/fixtures/tty-test.c b/test/functional/fixtures/tty-test.c
index 6ee7715021..f94af2fd12 100644
--- a/test/functional/fixtures/tty-test.c
+++ b/test/functional/fixtures/tty-test.c
@@ -1,6 +1,3 @@
-// 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>
@@ -11,8 +8,6 @@
# include <unistd.h>
#endif
-// -V:STRUCT_CAST:641
-#define STRUCT_CAST(Type, obj) ((Type *)(obj))
#define is_terminal(stream) (uv_guess_handle(fileno(stream)) == UV_TTY)
#define BUF_SIZE 0xfff
#define CTRL_C 0x03
@@ -108,10 +103,10 @@ static void read_cb(uv_stream_t *stream, ssize_t cnt, const uv_buf_t *buf)
.len = (size_t)cnt
#endif
};
- uv_write(&req, STRUCT_CAST(uv_stream_t, &out), &b, 1, NULL);
+ uv_write(&req, (uv_stream_t *)&out, &b, 1, NULL);
uv_run(&write_loop, UV_RUN_DEFAULT);
- uv_close(STRUCT_CAST(uv_handle_t, &out), NULL);
+ uv_close((uv_handle_t *)&out, NULL);
uv_run(&write_loop, UV_RUN_DEFAULT);
if (uv_loop_close(&write_loop)) {
abort();
@@ -181,7 +176,7 @@ int main(int argc, char **argv)
#endif
uv_tty_set_mode(&tty, UV_TTY_MODE_RAW);
tty.data = &interrupted;
- uv_read_start(STRUCT_CAST(uv_stream_t, &tty), alloc_cb, read_cb);
+ uv_read_start((uv_stream_t *)&tty, alloc_cb, read_cb);
#ifndef MSWIN
struct sigaction sa;
sigemptyset(&sa.sa_mask);
diff --git a/test/functional/fixtures/wildpum/Xdir/XdirA/XdirB/XfileC b/test/functional/fixtures/wildpum/Xnamedir/XdirA/XdirB/XfileC
index e69de29bb2..e69de29bb2 100644
--- a/test/functional/fixtures/wildpum/Xdir/XdirA/XdirB/XfileC
+++ b/test/functional/fixtures/wildpum/Xnamedir/XdirA/XdirB/XfileC
diff --git a/test/functional/fixtures/wildpum/Xdir/XdirA/XfileB b/test/functional/fixtures/wildpum/Xnamedir/XdirA/XfileB
index e69de29bb2..e69de29bb2 100644
--- a/test/functional/fixtures/wildpum/Xdir/XdirA/XfileB
+++ b/test/functional/fixtures/wildpum/Xnamedir/XdirA/XfileB
diff --git a/test/functional/fixtures/wildpum/Xdir/XfileA b/test/functional/fixtures/wildpum/Xnamedir/XfileA
index e69de29bb2..e69de29bb2 100644
--- a/test/functional/fixtures/wildpum/Xdir/XfileA
+++ b/test/functional/fixtures/wildpum/Xnamedir/XfileA