diff options
Diffstat (limited to 'tests/unit/core/test-eval.cpp')
-rw-r--r-- | tests/unit/core/test-eval.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/core/test-eval.cpp b/tests/unit/core/test-eval.cpp index 7fa22969d..742eb99bd 100644 --- a/tests/unit/core/test-eval.cpp +++ b/tests/unit/core/test-eval.cpp @@ -452,6 +452,18 @@ TEST(CoreEval, EvalReplaceRegex) NULL, NULL); CHECK(options); + /* replace regex by empty string (on empty string) */ + hashtable_remove (pointers, "regex"); + hashtable_set (options, "regex", ".*"); + hashtable_set (options, "regex_replace", ""); + WEE_CHECK_EVAL("", ""); + + /* replace regex (on empty string) */ + hashtable_remove (pointers, "regex"); + hashtable_set (options, "regex", ".*"); + hashtable_set (options, "regex_replace", "test"); + WEE_CHECK_EVAL("test", ""); + /* replace regex by empty string */ hashtable_remove (pointers, "regex"); hashtable_set (options, "regex", ".*"); |