diff options
| author | Albert Cervin <albert@acervin.com> | 2024-05-22 00:00:29 +0200 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2024-09-12 20:17:56 +0200 |
| commit | 405da5f84b072ea97b69359454899f45d92d24b6 (patch) | |
| tree | 20525b4bc44a5d8cbab4d62abe8413e174731db6 /test/command.c | |
| parent | 4ab7e453e26afc6e9f4938c65f89463fbba9e267 (diff) | |
| download | dged-405da5f84b072ea97b69359454899f45d92d24b6.tar.gz dged-405da5f84b072ea97b69359454899f45d92d24b6.tar.xz dged-405da5f84b072ea97b69359454899f45d92d24b6.zip | |
WIP LSP client
This contains the start of an LSP client.
Nothing (except starting the LSP server) works
at the moment and the feature is disabled by default.
Diffstat (limited to 'test/command.c')
| -rw-r--r-- | test/command.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/test/command.c b/test/command.c index 8db02e0..9920895 100644 --- a/test/command.c +++ b/test/command.c @@ -5,7 +5,7 @@ #include "dged/hash.h" #include "dged/hashmap.h" -void test_command_registry_create() { +void test_command_registry_create(void) { struct commands cmds = command_registry_create(10); ASSERT(HASHMAP_CAPACITY(&cmds.commands) == 10, @@ -17,6 +17,10 @@ void test_command_registry_create() { } int32_t fake_command(struct command_ctx ctx, int argc, const char *argv[]) { + (void)ctx; + (void)argc; + (void)argv; + return 0; } @@ -33,7 +37,7 @@ struct commands single_fake_command(const char *name) { return cmds; } -void test_register_command() { +void test_register_command(void) { struct commands cmds = command_registry_create(1); struct command cmd = { @@ -60,7 +64,7 @@ void test_register_command() { command_registry_destroy(&cmds); } -void test_lookup_command() { +void test_lookup_command(void) { struct commands cmds = single_fake_command("fake"); struct command *cmd = lookup_command(&cmds, "fake"); @@ -69,7 +73,6 @@ void test_lookup_command() { ASSERT_STR_EQ(cmd->name, "fake", "Expected the found function to have the correct name"); - struct command *also_cmd = lookup_command_by_hash(&cmds, hash_name("fake")); ASSERT(cmd != NULL, "Expected to be able to look up inserted command by hash"); ASSERT_STR_EQ(cmd->name, "fake", @@ -79,10 +82,14 @@ void test_lookup_command() { } int32_t failing_command(struct command_ctx ctx, int argc, const char *argv[]) { + (void)ctx; + (void)argc; + (void)argv; + return 100; } -void test_execute_command() { +void test_execute_command(void) { struct commands cmds = single_fake_command("fake"); struct command *cmd = lookup_command(&cmds, "fake"); @@ -101,7 +108,7 @@ void test_execute_command() { command_registry_destroy(&cmds); } -void run_command_tests() { +void run_command_tests(void) { run_test(test_command_registry_create); run_test(test_register_command); run_test(test_lookup_command); |
