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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user