Lines Matching defs:matcher
200 // Returns the description of the given matcher.
208 // Returns the description of the negation of the given matcher.
278 // Tests implementing a monomorphic matcher using MatchAndExplain().
307 // Tests default-constructing a matcher.
438 // matcher from its implementation using the old API.
463 // Using a polymorphic matcher to match a reference type.
471 // Using a polymorphic matcher to match a value type.
478 // Tests implementing a polymorphic matcher using MatchAndExplain().
529 // Tests that MatcherCast<T>(m) works when m is a polymorphic matcher.
655 // Verify that the matcher holds a reference to n, not to its temporary copy.
675 // Tests that SafeMatcherCast<T>(m) works when m is a polymorphic matcher.
763 // Verify that the matcher holds a reference to n, not to its temporary copy.
784 // Tests a matcher for a value type.
789 // Tests a matcher for a reference type.
813 // Tests a matcher for a value type.
818 // Tests a matcher for a reference type.
831 // Tests that _ can be used as a matcher for any type and matches any
834 // Uses _ as a matcher for a value type.
839 // Uses _ as a matcher for a reference type.
1131 // Test that Ref(non_const_varialbe) can be used as a matcher for a
2035 // Tests that monomorphic matchers are safely cast by the Not matcher.
2037 // greater_than_5 is a monomorphic matcher.
2084 // the sub-matchers are handled it is enough to test every sub-matcher once
2085 // with sub-matchers using the same matcher type. Varying matcher types are
2185 // Tests that monomorphic matchers are safely cast by the AllOf matcher.
2204 // matcher doesn't give an explanation, so only the first matcher's
2215 // matcher doesn't given an explanation.
2226 // Failed match. The first matcher, which failed, needs to
2231 // Failed match. The second matcher, which failed, needs to
2237 // Failed match. The second matcher, which failed, needs to
2282 // the sub-matchers are handled it is enough to test every sub-matcher once
2283 // with sub-matchers using the same matcher type. Varying matcher types are
2370 // Tests that monomorphic matchers are safely cast by the AnyOf matcher.
2389 // matcher doesn't give an explanation, so only the first matcher's
2400 // matcher doesn't given an explanation.
2411 // Successful match. The first matcher, which succeeded, needs to
2416 // Successful match. The second matcher, which succeeded, needs to
2422 // Successful match. The second matcher, which succeeded, needs to
2429 // testing the Truly(predicate) matcher.
2505 // Tests that Truly(predicate) works when the matcher takes its
2515 // matches matcher m.
2521 // Tests that Matches(m) works when the matcher takes its argument by
2537 // Tests Value(value, matcher). Since Value() is a simple wrapper for
2621 // matches the matcher.
2630 // doesn't match the matcher.
2671 // Tests that ASSERT_THAT() and EXPECT_THAT() work when the matcher is
3246 Matcher<Base*> matcher = WhenDynamicCastTo<Derived*>(Pointee(_));
3249 EXPECT_EQ(prefix + "points to a value that is anything", Describe(matcher));
3251 DescribeNegation(matcher));
3255 Matcher<Base*> matcher = WhenDynamicCastTo<Derived*>(Pointee(_));
3257 EXPECT_THAT(Explain(matcher, null), HasSubstr("NULL"));
3259 EXPECT_TRUE(matcher.Matches(&derived));
3260 EXPECT_THAT(Explain(matcher, &derived), HasSubstr("which points to "));
3262 // With references, the matcher itself can fail. Test for that one.
3460 // Note that the matcher expects DerivedStruct but we say AStruct
3473 // The field is an int, but the inner matcher expects a signed char.
3544 // Note that the matcher expects DerivedStruct but we say AStruct
3666 // The matcher expects a DerivedClass, but inside the Property() we
3681 // n() returns an int but the inner matcher expects a signed char.
3760 // The matcher expects a DerivedClass, but inside the Property() we
3805 Matcher<int> matcher = ResultOf(&IntToStringFunction, Eq(string("foo")));
3807 EXPECT_TRUE(matcher.Matches(1));
3808 EXPECT_FALSE(matcher.Matches(2));
3813 Matcher<int> matcher = ResultOf(&IntToStringFunction, StrEq("foo"));
3816 "is equal to \"foo\"", Describe(matcher));
3818 "isn't equal to \"foo\"", DescribeNegation(matcher));
3825 Matcher<int> matcher = ResultOf(&IntFunction, Ge(85));
3827 Explain(matcher, 36));
3829 matcher = ResultOf(&IntFunction, GreaterThan(85));
3831 ", which is 5 more than 85", Explain(matcher, 36));
3837 Matcher<int> matcher = ResultOf(&IntFunction, Eq(80));
3839 EXPECT_TRUE(matcher.Matches(42));
3840 EXPECT_FALSE(matcher.Matches(36));
3854 Matcher<double&> matcher = ResultOf(&DoubleFunction, Ref(x));
3856 EXPECT_TRUE(matcher.Matches(x));
3857 EXPECT_FALSE(matcher.Matches(x2));
3876 Matcher<const string&> matcher = ResultOf(&StringFunction, Ref(s));
3878 EXPECT_TRUE(matcher.Matches(s));
3879 EXPECT_FALSE(matcher.Matches(s2));
3885 // IntFunction() returns int but the inner matcher expects a signed char.
3886 Matcher<int> matcher = ResultOf(IntFunction, Matcher<signed char>(Ge(85)));
3888 EXPECT_TRUE(matcher.Matches(36));
3889 EXPECT_FALSE(matcher.Matches(42));
3903 Matcher<int> matcher = ResultOf(IntToStringFunction, StrEq("foo"));
3904 EXPECT_TRUE(matcher.Matches(1));
3905 EXPECT_FALSE(matcher.Matches(2));
3917 Matcher<int> matcher = ResultOf(Functor(), Eq(string("foo")));
3919 EXPECT_TRUE(matcher.Matches(1));
3920 EXPECT_FALSE(matcher.Matches(2));
3994 // Tests that when AllOf() fails, only the first failing matcher is
4001 // Tests that when AllOf() fails, only the first failing matcher is
4008 // Tests that when AllOf() fails, only the first failing matcher is
4840 // One naive implementation of the matcher runs in O(N!) time, which is too
4841 // slow for many real-world inputs. This test shows that our matcher can match
4905 "matcher #1: is equal to 2"));
4932 "matcher #0: is equal to 1\n"
4939 // Test helper for formatting element, matcher index pairs in expectations.
4940 static string EMString(int element, int matcher) {
4942 ss << "(element #" << element << ", matcher #" << matcher << ")";
5088 // to find one element per matcher, without reusing elements.