From 16245f44ae29c3859846d41c2d1f1446562fd4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 10 Nov 2025 19:31:00 +0100 Subject: [PATCH] tests: add unit tests on command `/help` --- tests/unit/core/test-core-command.cpp | 53 ++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/tests/unit/core/test-core-command.cpp b/tests/unit/core/test-core-command.cpp index be0a13738..1d8accd56 100644 --- a/tests/unit/core/test-core-command.cpp +++ b/tests/unit/core/test-core-command.cpp @@ -978,7 +978,58 @@ TEST(CoreCommand, Filter) TEST(CoreCommand, Help) { - /* TODO: write tests */ + WEE_CMD_CORE_ERROR_MSG( + "/help xxx", + "No help available, \"xxx\" is not a command or an option"); + + /* /help, /help -list, /help -listfull */ + WEE_CMD_CORE("/help"); + WEE_CHECK_MSG_CORE("", "[core]"); + WEE_CMD_CORE("/help -list"); + WEE_CHECK_MSG_CORE("", "[core]"); + WEE_CMD_CORE("/help -listfull"); + WEE_CHECK_MSG_CORE("", "[core]"); + WEE_CMD_CORE("/help -listfull core irc fset"); + WEE_CHECK_MSG_CORE("", "[core]"); + WEE_CHECK_MSG_CORE("", "[irc]"); + WEE_CHECK_MSG_CORE("", "[fset]"); + + /* /help */ + WEE_CMD_CORE("/help help"); + WEE_CHECK_MSG_CORE("", "display help about commands and options"); + + /* /help