[Flang][Runtime][tests] Escape regex special character.

The second argument of `ASSERT_DEATH` describes a regular expression, in
which parentheses have special meaning. Matches of literal parentheses
need to be escaped.

Fixes failure of InvalidFormatFailure.ParenMismatch and
InvalidFormatFailure.ParenMismatch when gtest is compiled with MSVC's
regex implementation.

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D104011
This commit is contained in:
Michael Kruse 2021-06-10 11:23:53 -05:00
parent cfbf61cd59
commit 0112f6ac71
1 changed files with 2 additions and 2 deletions

View File

@ -153,7 +153,7 @@ TEST(InvalidFormatFailure, ParenMismatch) {
ASSERT_DEATH(
context.Report(/*edit=*/control.GetNextDataEdit(context, repeat)),
"FORMAT missing at least one ')'");
R"(FORMAT missing at least one '\)')");
}
TEST(InvalidFormatFailure, MissingPrecision) {
@ -166,7 +166,7 @@ TEST(InvalidFormatFailure, MissingPrecision) {
ASSERT_DEATH(
context.Report(/*edit=*/control.GetNextDataEdit(context, repeat)),
"Invalid FORMAT: integer expected at ')'");
R"(Invalid FORMAT: integer expected at '\)')");
}
TEST(InvalidFormatFailure, MissingFormatWidth) {