diff options
Diffstat (limited to 'test/functional/fixtures')
-rw-r--r-- | test/functional/fixtures/CMakeLists.txt | 3 | ||||
-rw-r--r-- | test/functional/fixtures/fake-lsp-server.lua | 15 | ||||
-rw-r--r-- | test/functional/fixtures/printargs-test.c | 2 | ||||
-rw-r--r-- | test/functional/fixtures/shell-test.c | 17 | ||||
-rw-r--r-- | test/functional/fixtures/streams-test.c | 3 |
5 files changed, 26 insertions, 14 deletions
diff --git a/test/functional/fixtures/CMakeLists.txt b/test/functional/fixtures/CMakeLists.txt index 150407fe46..a388f9cb33 100644 --- a/test/functional/fixtures/CMakeLists.txt +++ b/test/functional/fixtures/CMakeLists.txt @@ -1,7 +1,4 @@ add_library(test_lib INTERFACE) -if(MINGW) - target_link_libraries(test_lib INTERFACE -municode) -endif() if(WIN32) target_compile_definitions(test_lib INTERFACE MSWIN) endif() diff --git a/test/functional/fixtures/fake-lsp-server.lua b/test/functional/fixtures/fake-lsp-server.lua index f813927f77..5d7ab2ad12 100644 --- a/test/functional/fixtures/fake-lsp-server.lua +++ b/test/functional/fixtures/fake-lsp-server.lua @@ -386,6 +386,21 @@ function tests.check_forward_content_modified() } end +function tests.check_forward_server_cancelled() + skeleton { + on_init = function() + return { capabilities = {} } + end, + body = function() + expect_request('error_code_test', function() + return { code = -32802 }, nil, { method = 'error_code_test', client_id = 1 } + end) + expect_notification('finish') + notify('finish') + end, + } +end + function tests.check_pending_request_tracked() skeleton { on_init = function(_) diff --git a/test/functional/fixtures/printargs-test.c b/test/functional/fixtures/printargs-test.c index 2c25cf8447..a1d3fdf76e 100644 --- a/test/functional/fixtures/printargs-test.c +++ b/test/functional/fixtures/printargs-test.c @@ -2,7 +2,7 @@ int main(int argc, char **argv) { - for (int i=1; i<argc; i++) { + for (int i = 1; i < argc; i++) { printf("arg%d=%s;", i, argv[i]); } return 0; diff --git a/test/functional/fixtures/shell-test.c b/test/functional/fixtures/shell-test.c index bd71e7d11b..f3e94a28da 100644 --- a/test/functional/fixtures/shell-test.c +++ b/test/functional/fixtures/shell-test.c @@ -1,11 +1,12 @@ +#include <stdbool.h> +#include <stdint.h> #include <stdio.h> #include <string.h> -#include <stdint.h> #ifdef _MSC_VER -#include <Windows.h> -#define usleep(usecs) Sleep(usecs/1000) +# include <Windows.h> +# define usleep(usecs) Sleep(usecs/1000) #else -#include <unistd.h> +# include <unistd.h> #endif static void flush_wait(void) @@ -56,7 +57,7 @@ int main(int argc, char **argv) if (argc >= 2) { if (strcmp(argv[1], "-t") == 0) { if (argc < 3) { - fprintf(stderr,"Missing prompt text for -t option\n"); + fprintf(stderr, "Missing prompt text for -t option\n"); return 5; } else { fprintf(stderr, "%s $ ", argv[2]); @@ -107,18 +108,18 @@ int main(int argc, char **argv) char cmd[100]; int arg; - while (1) { + while (true) { fprintf(stderr, "interact $ "); if (fgets(input, sizeof(input), stdin) == NULL) { break; // EOF } - if(1 == sscanf(input, "%99s %d", cmd, &arg)) { + if (1 == sscanf(input, "%99s %d", cmd, &arg)) { arg = 0; } if (strcmp(cmd, "exit") == 0) { - return arg; + return arg; } else { fprintf(stderr, "command not found: %s\n", cmd); } diff --git a/test/functional/fixtures/streams-test.c b/test/functional/fixtures/streams-test.c index 5a59abb33b..68e668d5fa 100644 --- a/test/functional/fixtures/streams-test.c +++ b/test/functional/fixtures/streams-test.c @@ -1,6 +1,5 @@ /// Helper program to exit and keep stdout open (like "xclip -i -loops 1"). #include <stdio.h> - #include <uv.h> int main(int argc, char **argv) @@ -8,7 +7,7 @@ int main(int argc, char **argv) uv_loop_t *loop = uv_default_loop(); uv_process_t child_req; - char * args[3]; + char *args[3]; args[0] = "sleep"; args[1] = "10"; args[2] = NULL; |