Merge "utils.h: quote regex match failure messages." into main am: e852abd1fc

Original change: https://android-review.googlesource.com/c/platform/bionic/+/3092844

Change-Id: Ibd5d6462e9d46d9bb0775919ad3ce2737e4dbbe4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Elliott Hughes 2024-05-20 18:50:35 +00:00 committed by Automerger Merge Worker
commit 831c924a1c

View file

@ -38,6 +38,7 @@
#endif
#include <atomic>
#include <iomanip>
#include <string>
#include <regex>
@ -253,7 +254,7 @@ class ExecTestHelper {
AssertChildExited(pid, expected_exit_status, &error_msg);
if (expected_output_regex != nullptr) {
if (!std::regex_search(output_, std::regex(expected_output_regex))) {
FAIL() << "regex " << expected_output_regex << " didn't match " << output_;
FAIL() << "regex " << std::quoted(expected_output_regex) << " didn't match " << std::quoted(output_);
}
}
}