Skip to content

Commit 2ddfd54

Browse files
yfeldblumfacebook-github-bot
authored andcommitted
let test AsyncFileWriter.fork use HasSubstr
Summary: X-link: facebook/folly#2458 Let this test use `HasSubstr` v.s. `ContainsRegex` since the provided pattern is not even a regex - it's just a substring to search for. Reviewed By: ilvokhin Differential Revision: D77421549 fbshipit-source-id: 9d3610a9797ecb32d0d7d607ac33c109516514e2
1 parent dba105f commit 2ddfd54

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

third-party/folly/src/folly/logging/test/AsyncFileWriterTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ using folly::test::TemporaryFile;
7777
using std::chrono::milliseconds;
7878
using std::chrono::steady_clock;
7979
using testing::ContainsRegex;
80+
using testing::HasSubstr;
8081

8182
TEST(AsyncFileWriter, noMessages) {
8283
TemporaryFile tmpFile{"logging_test"};
@@ -731,10 +732,9 @@ TEST(AsyncFileWriter, fork) {
731732
// The log file should contain all of the messages we wrote, from both the
732733
// parent and child processes.
733734
for (size_t n = 0; n < numMessages; ++n) {
734-
EXPECT_THAT(
735-
data, ContainsRegex(folly::to<std::string>("prefork", n, "\n")));
736-
EXPECT_THAT(data, ContainsRegex(folly::to<std::string>("parent", n, "\n")));
737-
EXPECT_THAT(data, ContainsRegex(folly::to<std::string>("child", n, "\n")));
735+
EXPECT_THAT(data, HasSubstr(folly::to<std::string>("prefork", n, "\n")));
736+
EXPECT_THAT(data, HasSubstr(folly::to<std::string>("parent", n, "\n")));
737+
EXPECT_THAT(data, HasSubstr(folly::to<std::string>("child", n, "\n")));
738738
}
739739
#else
740740
SKIP() << "pthread_atfork() is not supported on this platform";

0 commit comments

Comments
 (0)