From 4e19e6ab1bd24466d9dcb0d8eea54a7e3d84d576 Mon Sep 17 00:00:00 2001 From: nodist Date: Sun, 20 Sep 2026 13:22:50 -0400 Subject: kpl config set module extension --- test/config.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/config.c (limited to 'test/config.c') diff --git a/test/config.c b/test/config.c new file mode 100644 index 0000000..8a1dc64 --- /dev/null +++ b/test/config.c @@ -0,0 +1,21 @@ + +#include "kpl_test.h" + +KPL_TEST(config_show_help) { + kpl_config config; + const int32_t argc = 2; + const char *argv[] = { "./kpl", "--help", "not_used" }; + kpl_config_init(&config); + int32_t code = kpl_config_parse_args(&config, argc, argv); + KPL_ASSERT(code == KPL_EXIT_CODE_HELP, "Invalid help exit code"); +} + +KPL_TEST(config_change_module_extension) { + kpl_config config; + const int32_t argc = 3; + const char *argv[] = { "./kpl", "--module-extension=.l", "./file.l" }; + kpl_config_init(&config); + int32_t code = kpl_config_parse_args(&config, argc, argv); + KPL_ASSERT(code == KPL_EXIT_CODE_SUCCESS, "Invalid exit code"); + KPL_ASSERT(strcmp(config.module_extension, ".l") == 0, "Invalid new module extension"); +} -- cgit v1.2.3