Fix CaptureStderrRAII for Windows

This commit is contained in:
Sebastian Messmer 2018-09-07 04:59:16 -07:00
parent 916632279b
commit 9b990b4fd1
1 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@
#include <cpp-utils/macros.h>
#include <iostream>
#include <gmock/gmock.h>
#include <regex>
namespace cpputils {
@ -27,7 +28,9 @@ public:
}
void EXPECT_MATCHES(const std::string &regex) {
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: