summaryrefslogtreecommitdiff
path: root/tests/unit/core/test-string.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-12-31 19:07:14 +0100
committerSébastien Helleu <flashcode@flashtux.org>2015-12-31 19:07:14 +0100
commit57b6e320d3c9d2d9473090eb3881de206c81e52c (patch)
tree04e7783733c8b900aa44bfee27403d92bd0cc671 /tests/unit/core/test-string.cpp
parent295158d3e1cd148315d5c383da5980c3e1157396 (diff)
downloadweechat-57b6e320d3c9d2d9473090eb3881de206c81e52c.zip
core: fix execution of empty command name
The strings "/" and "/ " are not considered as valid commands any more.
Diffstat (limited to 'tests/unit/core/test-string.cpp')
-rw-r--r--tests/unit/core/test-string.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/unit/core/test-string.cpp b/tests/unit/core/test-string.cpp
index cf1a6c464..63fd7f095 100644
--- a/tests/unit/core/test-string.cpp
+++ b/tests/unit/core/test-string.cpp
@@ -1214,11 +1214,25 @@ TEST(String, Input)
/* string_input_for_buffer */
POINTERS_EQUAL(NULL, string_input_for_buffer (NULL));
- POINTERS_EQUAL(NULL, string_input_for_buffer ("/"));
POINTERS_EQUAL(NULL, string_input_for_buffer ("/abc"));
str = strdup ("");
STRCMP_EQUAL(str, string_input_for_buffer (str));
free (str);
+ str = strdup ("/");
+ STRCMP_EQUAL(str, string_input_for_buffer (str));
+ free (str);
+ str = strdup ("/ ");
+ STRCMP_EQUAL(str, string_input_for_buffer (str));
+ free (str);
+ str = strdup ("/ abc");
+ STRCMP_EQUAL(str, string_input_for_buffer (str));
+ free (str);
+ str = strdup ("/ /");
+ STRCMP_EQUAL(str, string_input_for_buffer (str));
+ free (str);
+ str = strdup ("/*");
+ STRCMP_EQUAL(str, string_input_for_buffer (str));
+ free (str);
str = strdup ("abc");
STRCMP_EQUAL(str, string_input_for_buffer (str));
free (str);