summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWojciech Kwolek <me@irth.pl>2016-05-08 12:14:17 +0200
committerWojciech Kwolek <me@irth.pl>2016-05-08 12:14:17 +0200
commita44bcaf080cfc2d534daae02306a9f833eb8f257 (patch)
treec9db4ab881b3849b4c0766c24b3faaf134ccfccd /tests
parent2d5ea374af310924aea225ecd42d5eb0fd2d2e96 (diff)
downloadweechat-a44bcaf080cfc2d534daae02306a9f833eb8f257.zip
core: fix the hardcoded separator in string_split_command
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/core/test-string.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/core/test-string.cpp b/tests/unit/core/test-string.cpp
index 67e578d45..46314eb2b 100644
--- a/tests/unit/core/test-string.cpp
+++ b/tests/unit/core/test-string.cpp
@@ -942,6 +942,16 @@ TEST(String, SplitCommand)
string_free_split_command (argv);
+ /* separator other than ';' */
+ argv = string_split_command ("abc,de,fghi", ',');
+ CHECK(argv);
+ STRCMP_EQUAL("abc", argv[0]);
+ STRCMP_EQUAL("de", argv[1]);
+ STRCMP_EQUAL("fghi", argv[2]);
+ POINTERS_EQUAL(NULL, argv[3]);
+
+ string_free_split_command (argv);
+
/* free split with NULL */
string_free_split_command (NULL);
}