From fdc59ffd050af9ba60a031b2799fc3f5caba1330 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 22 Jan 2019 16:50:28 -0500 Subject: Googletest export Add AllOfArray matcher that verifies a value matches all member of some array/container/list/set/..., e.g: EXPECT_THAT(1, AnyOfArray({1, 2, 3})) In the simplest form this is identical to AnyOf(1, 2, 3). But unlike that one it works on containers. Add AnyOfArray matcher that verifies a value matches any member of some array/container/list/set/... PiperOrigin-RevId: 230403653 --- googlemock/include/gmock/gmock-matchers.h | 113 ++++++++++++++++++ googlemock/test/gmock-generated-matchers_test.cc | 142 +++++++++++++++++++++++ 2 files changed, 255 insertions(+) diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 2cb7028..fa24fd2 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -1175,6 +1175,37 @@ class AnyOfMatcherImpl : public MatcherInterface { template using AnyOfMatcher = VariadicMatcher; +// Wrapper for implementation of Any/AllOfArray(). +template