1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

core: add repeat of string in evaluation of expressions with "repeat:count,string" (closes #958)

This commit is contained in:
Sébastien Helleu
2018-10-09 21:12:02 +02:00
parent 82697714e1
commit 8da3458f4c
30 changed files with 515 additions and 337 deletions
+18
View File
@@ -292,6 +292,24 @@ TEST(CoreString, Reverse)
STRCMP_EQUAL("\xeblon", string_reverse ("no\xebl"));
}
/*
* Tests functions:
* string_repeat
*/
TEST(CoreString, Repeat)
{
POINTERS_EQUAL(NULL, string_repeat (NULL, 1));
STRCMP_EQUAL("", string_repeat ("", 1));
STRCMP_EQUAL("", string_repeat ("x", -1));
STRCMP_EQUAL("", string_repeat ("x", 0));
STRCMP_EQUAL("x", string_repeat ("x", 1));
STRCMP_EQUAL("xxx", string_repeat ("x", 3));
STRCMP_EQUAL("abcabc", string_repeat ("abc", 2));
STRCMP_EQUAL("noëlnoël", string_repeat ("noël", 2));
}
/*
* Tests functions:
* string_strcasecmp