summaryrefslogtreecommitdiff
path: root/tests/unit/core/test-core-command.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-01-12 21:44:17 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-01-28 15:13:36 +0100
commit0dd1d1be1c5f1084802daf89e988f2c1d84559c7 (patch)
treed9292ed2fcc6e0a9950807532a1e81188bc787fd /tests/unit/core/test-core-command.cpp
parent202b4d82c0b233a891e9e1a303833c15ae86e1d4 (diff)
downloadweechat-0dd1d1be1c5f1084802daf89e988f2c1d84559c7.zip
core: sort configuration files by name, reload them by priority (issue #1872)
Diffstat (limited to 'tests/unit/core/test-core-command.cpp')
-rw-r--r--tests/unit/core/test-core-command.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/unit/core/test-core-command.cpp b/tests/unit/core/test-core-command.cpp
index 0a24a0ff0..d2ec90bd0 100644
--- a/tests/unit/core/test-core-command.cpp
+++ b/tests/unit/core/test-core-command.cpp
@@ -42,7 +42,7 @@ extern "C"
command_record ("core.weechat", __command);
#define WEE_CHECK_MSG_BUFFER(__buffer_name, __message) \
- if (!record_search (__buffer_name, __message)) \
+ if (record_search (__buffer_name, __message) < 0) \
{ \
char **msg = command_build_error ( \
"Message not displayed on buffer " __buffer_name ": " \
@@ -54,6 +54,8 @@ extern "C"
#define WEE_CHECK_MSG_CORE(__message) \
WEE_CHECK_MSG_BUFFER("core.weechat", __message);
+#define WEE_SEARCH_MSG_CORE(__message) \
+ record_search ("core.weechat", __message)
TEST_GROUP(CoreCommand)
@@ -369,7 +371,12 @@ TEST(CoreCommand, Quit)
TEST(CoreCommand, Reload)
{
- /* TODO: write tests */
+ WEE_CMD_CORE("/save");
+ WEE_CMD_CORE("/reload");
+ LONGS_EQUAL(0, WEE_SEARCH_MSG_CORE("Options reloaded from sec.conf"));
+ LONGS_EQUAL(1, WEE_SEARCH_MSG_CORE("Options reloaded from weechat.conf"));
+ LONGS_EQUAL(2, WEE_SEARCH_MSG_CORE("Options reloaded from plugins.conf"));
+ LONGS_EQUAL(3, WEE_SEARCH_MSG_CORE("Options reloaded from charset.conf"));
}
/*