forked from OSchip/llvm-project
[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:
parent
cfbf61cd59
commit
0112f6ac71
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue