1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

api: add special value - (hyphen-minus) in options of function command_options to prevent execution of commands (issue #2199)

This commit is contained in:
Sébastien Helleu
2024-10-13 10:51:33 +02:00
parent 709b2b5796
commit bca7c7438a
8 changed files with 60 additions and 25 deletions
+9
View File
@@ -182,6 +182,15 @@ TEST(CoreInput, Data)
RECORD_CHECK_MSG("core.test", "", "line2", NULL);
LONGS_EQUAL(2, record_count_messages ());
/* on core buffer: valid command but with commands disabled */
TEST_INPUT_DATA(WEECHAT_RC_ERROR, gui_buffers, "/print core\n/print line2", "-", 0, 0);
RECORD_CHECK_MSG("core.weechat", "=!=", "You cannot write text in this buffer", NULL);
LONGS_EQUAL(1, record_count_messages ());
/* on test buffer: valid command but with commands disabled */
TEST_INPUT_DATA(WEECHAT_RC_OK, buffer, "/print core\n/print line2", "-", 0, 0);
RECORD_CHECK_NO_MSG();
gui_buffer_close (buffer);
}