mu-regex: add multiline test

This commit is contained in:
Dirk-Jan C. Binnema
2023-07-30 00:50:45 +03:00
parent 3a38d6366a
commit 33fd79a9f0

View File

@ -60,10 +60,17 @@ test_regex_match2()
static void
test_regex_replace()
{
auto rx = Regex::make("f.o");
assert_valid_result(rx);
{
auto rx = Regex::make("f.o");
assert_valid_result(rx);
assert_equal(rx->replace("foobar", "cuux"), "cuuxbar");
}
assert_equal(rx->replace("foobar", "cuux"), "cuuxbar");
{
auto rx = Regex::make("f.o", G_REGEX_MULTILINE);
assert_valid_result(rx);
assert_equal(rx->replace("foobar\nfoobar", "cuux"), "cuuxbar\ncuuxbar");
}
}
int