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 <yaneurabeya@gmail.com>
pull/4334/head
Enji Cooper 1 year ago
parent 6abc9e3d79
commit 77485ff004
  1. 4
      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.

Loading…
Cancel
Save