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

@ -59,13 +59,20 @@ test_regex_match2()
static void static void
test_regex_replace() test_regex_replace()
{
{ {
auto rx = Regex::make("f.o"); auto rx = Regex::make("f.o");
assert_valid_result(rx); 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 int
main(int argc, char* argv[]) main(int argc, char* argv[])
try { try {