1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 01:03:14 +02:00

tests: add tests of regex replace with empty regex or regex_replace

This commit is contained in:
Sébastien Helleu
2014-11-23 08:32:52 +01:00
parent ae013b7881
commit b460055f78
+18
View File
@@ -262,6 +262,24 @@ TEST(Eval, EvalReplaceRegex)
NULL, NULL);
CHECK(options);
/* replace regex by empty string */
hashtable_remove (pointers, "regex");
hashtable_set (options, "regex", ".*");
hashtable_set (options, "regex_replace", "");
WEE_CHECK_EVAL("", "test");
/* replace empty regex */
hashtable_remove (pointers, "regex");
hashtable_set (options, "regex", "");
hashtable_set (options, "regex_replace", "abc");
WEE_CHECK_EVAL("test", "test");
/* replace empty regex by empty string */
hashtable_remove (pointers, "regex");
hashtable_set (options, "regex", "");
hashtable_set (options, "regex_replace", "");
WEE_CHECK_EVAL("test", "test");
/* add brackets around URLs (regex as string) */
hashtable_remove (pointers, "regex");
hashtable_set (options, "regex", "\\w+://\\S+");