From 9b990b4fd1543e0d21616c80969694be2d73920f Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Fri, 7 Sep 2018 04:59:16 -0700 Subject: [PATCH] Fix CaptureStderrRAII for Windows --- src/cpp-utils/testutils/CaptureStderrRAII.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cpp-utils/testutils/CaptureStderrRAII.h b/src/cpp-utils/testutils/CaptureStderrRAII.h index 353be174..091331f1 100644 --- a/src/cpp-utils/testutils/CaptureStderrRAII.h +++ b/src/cpp-utils/testutils/CaptureStderrRAII.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace cpputils { @@ -27,7 +28,9 @@ public: } void EXPECT_MATCHES(const std::string ®ex) { - EXPECT_THAT(get_stderr(), testing::MatchesRegex(".*" + regex + ".*")); + // TODO For some reason this doesn't work on MSVC + // EXPECT_THAT(get_stderr(), testing::MatchesRegex(".*" + regex + ".*")); + EXPECT_TRUE(std::regex_search(get_stderr(), std::regex(regex, std::regex::basic))); } private: