From 83167450614b5cf8b9b3ba49c6db468aad222178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 11 Nov 2025 12:08:55 +0100 Subject: [PATCH] tests: add unit tests on command `/repeat` --- tests/unit/core/test-core-command.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/unit/core/test-core-command.cpp b/tests/unit/core/test-core-command.cpp index c7a4e66f8..a647d176d 100644 --- a/tests/unit/core/test-core-command.cpp +++ b/tests/unit/core/test-core-command.cpp @@ -1372,7 +1372,23 @@ TEST(CoreCommand, Reload) TEST(CoreCommand, Repeat) { - /* TODO: write tests */ + WEE_CMD_CORE_MIN_ARGS("/repeat", "/repeat"); + WEE_CMD_CORE_MIN_ARGS("/repeat 2", "/repeat"); + + /* /repeat */ + WEE_CMD_CORE_ERROR_MSG("/repeat xxx /yyy", "Invalid number: \"xxx\""); + WEE_CMD_CORE("/repeat 2 /print test ${repeat_index}"); + WEE_CHECK_MSG_CORE("", "test 1"); + WEE_CHECK_MSG_CORE("", "test 2"); + + /* /repeat -interval */ + WEE_CMD_CORE_MIN_ARGS("/repeat -interval", "/repeat"); + WEE_CMD_CORE_ERROR_GENERIC("/repeat -interval xxx 2 /yyy"); + WEE_CMD_CORE("/repeat -interval 0 2 /print test"); + WEE_CHECK_MSG_CORE("", "test"); + WEE_CMD_CORE("/repeat -interval 0 2 /print test ${repeat_index}"); + WEE_CHECK_MSG_CORE("", "test 1"); + WEE_CHECK_MSG_CORE("", "test 2"); } /*