summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-05-21 10:06:51 +0200
committerSébastien Helleu <flashcode@flashtux.org>2020-05-21 10:06:51 +0200
commitaaa49d3188bbd4fb9a7098dfef5cb1ad0bd5f4b3 (patch)
treedf696697bc0b74911175ce852a8eef8782e23e6f
parentf4913d0a6ba2af80e350ef0cc54359e0bebdba8b (diff)
downloadweechat-aaa49d3188bbd4fb9a7098dfef5cb1ad0bd5f4b3.zip
tests: add tests on function string_input_for_buffer with custom command chars
-rw-r--r--tests/unit/core/test-core-string.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-string.cpp b/tests/unit/core/test-core-string.cpp
index 35f4b4063..686c06edb 100644
--- a/tests/unit/core/test-core-string.cpp
+++ b/tests/unit/core/test-core-string.cpp
@@ -2038,6 +2038,33 @@ TEST(CoreString, InputForBuffer)
str = strdup ("//abc");
STRCMP_EQUAL(str + 1, string_input_for_buffer (str));
free (str);
+
+ /* test with custom command chars */
+ config_file_option_set (config_look_command_chars, "öï", 1);
+
+ str = strdup ("o_abc");
+ STRCMP_EQUAL(str, string_input_for_buffer (str));
+ free (str);
+ str = strdup ("ö_abc");
+ POINTERS_EQUAL(NULL, string_input_for_buffer (str));
+ free (str);
+ str = strdup ("ö abc");
+ STRCMP_EQUAL(str, string_input_for_buffer (str));
+ free (str);
+ str = strdup ("öö_abc");
+ STRCMP_EQUAL(str + 2, string_input_for_buffer (str));
+ free (str);
+ str = strdup ("ï_abc");
+ POINTERS_EQUAL(NULL, string_input_for_buffer (str));
+ free (str);
+ str = strdup ("ï abc");
+ STRCMP_EQUAL(str, string_input_for_buffer (str));
+ free (str);
+ str = strdup ("ïï_abc");
+ STRCMP_EQUAL(str + 2, string_input_for_buffer (str));
+ free (str);
+
+ config_file_option_reset (config_look_command_chars, 0);
}
/*