diff options
Diffstat (limited to 'test/gmock-matchers_test.cc')
-rw-r--r-- | test/gmock-matchers_test.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/gmock-matchers_test.cc b/test/gmock-matchers_test.cc index 66459464..3ec2989e 100644 --- a/test/gmock-matchers_test.cc +++ b/test/gmock-matchers_test.cc @@ -721,6 +721,15 @@ TEST(ATest, MatchesAnyValue) { EXPECT_TRUE(m2.Matches(b)); } +TEST(ATest, WorksForDerivedClass) { + Base base; + Derived derived; + EXPECT_THAT(&base, A<Base*>()); + // This shouldn't compile: EXPECT_THAT(&base, A<Derived*>()); + EXPECT_THAT(&derived, A<Base*>()); + EXPECT_THAT(&derived, A<Derived*>()); +} + // Tests that A<T>() describes itself properly. TEST(ATest, CanDescribeSelf) { EXPECT_EQ("is anything", Describe(A<bool>())); |