From 77485ff0046136f89f14d5e7a51e98849dc00691 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Mon, 7 Aug 2023 21:36:44 -0700 Subject: [PATCH] Fix RETest/1.ImplicitConstructorWorks on non-ABSL platforms The last regular expression specified in the test is not technically POSIX compatible. Use `[[:alnum:]_]` instead of `\w+`; the latter is a Perl-compatible regular expression. Signed-off-by: Enji Cooper --- googletest/test/googletest-port-test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/test/googletest-port-test.cc b/googletest/test/googletest-port-test.cc index 32a2a7b4..e0793bad 100644 --- a/googletest/test/googletest-port-test.cc +++ b/googletest/test/googletest-port-test.cc @@ -418,8 +418,8 @@ TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE simple(TypeParam("hello")); EXPECT_STREQ("hello", simple.pattern()); - const RE normal(TypeParam(".*(\\w+)")); - EXPECT_STREQ(".*(\\w+)", normal.pattern()); + const RE normal(TypeParam(".*([[:alnum:]_]+)")); + EXPECT_STREQ(".*([[:alnum:]_]+)", normal.pattern()); } // Tests that RE's constructors reject invalid regular expressions.