Lines Matching defs:matcher

108 // matches the matcher.
117 // doesn't match the matcher.
153 // Tests that ASSERT_THAT() and EXPECT_THAT() work when the matcher is
228 // matcher.
270 // matcher.
456 // Note that the matcher expects DerivedStruct but we say AStruct
469 // The field is an int, but the inner matcher expects a signed char.
562 // Note that the matcher expects DerivedStruct but we say AStruct
739 // The matcher expects a DerivedClass, but inside the Property() we
754 // n() returns an int but the inner matcher expects a signed char.
860 // The matcher expects a DerivedClass, but inside the Property() we
933 Matcher<int> matcher = ResultOf(&IntToStringFunction, Eq(std::string("foo")));
935 EXPECT_TRUE(matcher.Matches(1));
936 EXPECT_FALSE(matcher.Matches(2));
941 Matcher<int> matcher = ResultOf(&IntToStringFunction, StrEq("foo"));
946 Describe(matcher));
950 DescribeNegation(matcher));
955 Matcher<int> matcher =
958 EXPECT_EQ("whose string conversion is equal to \"foo\"", Describe(matcher));
960 DescribeNegation(matcher));
967 Matcher<int> matcher = ResultOf(&IntFunction, Ge(85));
969 Explain(matcher, 36));
971 matcher = ResultOf(&IntFunction, GreaterThan(85));
974 Explain(matcher, 36));
978 Matcher<int> matcher = ResultOf("magic int conversion", &IntFunction, Ge(85));
980 Explain(matcher, 36));
982 matcher = ResultOf("magic int conversion", &IntFunction, GreaterThan(85));
985 Explain(matcher, 36));
991 Matcher<int> matcher = ResultOf(&IntFunction, Eq(80));
993 EXPECT_TRUE(matcher.Matches(42));
994 EXPECT_FALSE(matcher.Matches(36));
1008 Matcher<double&> matcher = ResultOf(&DoubleFunction, Ref(x));
1010 EXPECT_TRUE(matcher.Matches(x));
1011 EXPECT_FALSE(matcher.Matches(x2));
1029 Matcher<const std::string&> matcher = ResultOf(&StringFunction, Ref(s));
1031 EXPECT_TRUE(matcher.Matches(s));
1032 EXPECT_FALSE(matcher.Matches(s2));
1038 // IntFunction() returns int but the inner matcher expects a signed char.
1039 Matcher<int> matcher = ResultOf(IntFunction, Matcher<signed char>(Ge(85)));
1041 EXPECT_TRUE(matcher.Matches(36));
1042 EXPECT_FALSE(matcher.Matches(42));
1057 Matcher<int> matcher = ResultOf(IntToStringFunction, StrEq("foo"));
1058 EXPECT_TRUE(matcher.Matches(1));
1059 EXPECT_FALSE(matcher.Matches(2));
1069 Matcher<int> matcher = ResultOf(Functor(), Eq(std::string("foo")));
1071 EXPECT_TRUE(matcher.Matches(1));
1072 EXPECT_FALSE(matcher.Matches(2));
1098 Matcher<int*> matcher = ResultOf(PolymorphicFunctor(), "good ptr");
1101 EXPECT_TRUE(matcher.Matches(&n));
1102 EXPECT_FALSE(matcher.Matches(nullptr));
1106 Matcher<int> matcher = ResultOf(
1111 EXPECT_TRUE(matcher.Matches(3));
1112 EXPECT_FALSE(matcher.Matches(1));
1116 Matcher<std::unique_ptr<int>> matcher = ResultOf(
1121 EXPECT_TRUE(matcher.Matches(std::unique_ptr<int>(new int(3))));
1122 EXPECT_FALSE(matcher.Matches(std::unique_ptr<int>(new int(1))));
1618 "matcher #0: is equal to 1"));
1625 " - element #0 is matched by matcher #1,\n"
1626 " - element #2 is matched by matcher #0"));
1753 " - element #0 is matched by matcher #1,\n"
1754 " - element #1 is matched by matcher #2"));
1973 // One naive implementation of the matcher runs in O(N!) time, which is too
1974 // slow for many real-world inputs. This test shows that our matcher can match
2020 "matcher #0: is equal to 1,\n"
2021 "matcher #1: is equal to 2,\n"
2022 "matcher #2: is equal to 3\n"
2034 "matcher #0: is equal to 1,\n"
2035 "matcher #1: is equal to 2,\n"
2036 "matcher #2: is equal to 3"));
2048 "matcher #1: is equal to 2"));
2073 "matcher #0: is equal to 1\n"
2080 // Test helper for formatting element, matcher index pairs in expectations.
2081 static std::string EMString(int element, int matcher) {
2083 ss << "(element #" << element << ", matcher #" << matcher << ")";
2510 // A matcher that can return different results when used multiple times on the
2511 // same input. No real matcher should do this; but this lets us test that we
2532 // simulating a flaky matcher.
2548 auto matcher = MakeMatcher(new MockMatcher);
2550 matcher);
2577 " The matcher failed on the initial attempt; but passed when rerun to "
2861 // Changing x and y now shouldn't affect the meaning of the above matcher.