Home | History | Annotate | Download | only in test

Lines Matching defs:MATCHER

70 using testing::Matcher;
87 // Returns the description of the given matcher.
89 string Describe(const Matcher<T>& m) {
95 // Returns the description of the negation of the given matcher.
97 string DescribeNegation(const Matcher<T>& m) {
146 // The MATCHER*() macros trigger warning C4100 (unreferenced formal
156 MATCHER(SumIsZero, "") {
173 const Matcher<Tuple3> m = Args<1, 2>(Lt());
180 const Matcher<const Tuple3&> m = Args<0, 1>(Lt());
200 const Matcher<tuple<int, bool, char> > m = Args<2, 0>(Lt());
207 const Matcher<const tuple<int, bool, char, int>&> m =
215 const Matcher<tuple<int, char> > m = Args<1, 0>(Gt());
222 const Matcher<tuple<bool, int, int> > m = Args<1, 2>(Eq());
245 Matcher<tuple<char, int> > LessThan() {
250 const Matcher<tuple<char, int, int> > m = Args<0, 2>(LessThan());
285 Matcher<int> GreaterThan(int n) {
292 Matcher<const vector<int>&> m = ElementsAre();
297 Matcher<vector<int> > m = ElementsAre(Gt(5));
302 Matcher<list<string> > m = ElementsAre(StrEq("one"), "two");
309 Matcher<vector<int> > m = ElementsAre();
314 Matcher<const list<int>& > m = ElementsAre(Gt(5));
320 Matcher<const list<string>& > m = ElementsAre("one", "two");
327 Matcher<const list<int>& > m = ElementsAre(1, Ne(2));
336 Matcher<const vector<int>& > m =
347 Matcher<const list<int>& > m = ElementsAre(1, 3);
358 Matcher<const vector<int>& > m = ElementsAre(1, GreaterThan(5));
438 Matcher<vector<string> > m = ElementsAre(StrEq("test string"));
446 Matcher<vector<string> > m = ElementsAre(StrEq("test string"));
456 Matcher<vector<string> > m = ElementsAre(
569 // Changing x and y now shouldn't affect the meaning of the above matcher.
614 const Matcher<string> kMatcherArray[] =
666 EXPECT_THAT(a, ElementsAreArray<Matcher<int> >(
668 EXPECT_THAT(a, Not(ElementsAreArray<Matcher<int> >(
676 const Matcher<int> kMatchers[] = { Eq(1), Eq(2), Eq(3) };
678 const vector<Matcher<int> > expected(
725 // Tests for the MATCHER*() macro family.
727 // Tests that a simple MATCHER() definition works.
729 MATCHER(IsEven, "") { return (arg % 2) == 0; }
732 const Matcher<int> m = IsEven();
743 MATCHER(IsEven2, negation ? "is odd" : "is even") {
746 // supplied by the MATCHER macro implicitly.
755 // This also tests that the description string can reference matcher
773 // Tests that the matcher description can reference 'negation' and the
774 // matcher parameters.
776 const Matcher<int> m1 = IsEven2();
780 const Matcher<int> m2 = EqSumOf(5, 9);
785 // Tests explaining match result in a MATCHER* macro.
787 const Matcher<int> m1 = IsEven2();
791 const Matcher<int> m2 = EqSumOf(1, 2);
796 // Tests that the body of MATCHER() can reference the type of the
799 MATCHER(IsEmptyString, "") {
804 MATCHER(IsEmptyStringByRef, "") {
810 const Matcher< ::std::string> m1 = IsEmptyString();
813 const Matcher<const ::std::string&> m2 = IsEmptyStringByRef();
817 // Tests that MATCHER() can be used in a namespace.
820 MATCHER(IsOdd, "") { return (arg % 2) != 0; }
824 Matcher<int> m = matcher_test::IsOdd();
830 MATCHER(IsPositiveOdd, "") {
845 const Matcher<int> m = IsGreaterThan32And(5);
855 // Tests that the description is calculated correctly from the matcher name.
859 const Matcher<int> m = _is_Greater_Than32and_(5);
867 // Tests that a MATCHER_P matcher can be explicitly instantiated with
884 const Matcher<const UncopyableFoo&> m =
912 // Tests that a MATCHER_Pn matcher can be explicitly instantiated with
921 const Matcher<const UncopyableFoo&> m =
932 const Matcher<const UncopyableFoo&> m =
948 const Matcher<const long&> m = IsNotInClosedRange(10, 20); // NOLINT
958 // Tests that MATCHER*() definitions can be overloaded on the number
961 MATCHER(EqualsSumOf, "") { return arg == 0; }
1036 // Tests that the matcher body can promote the parameter types.
1046 Matcher<std::string> no_promo =
1048 Matcher<const std::string&> promo =
1056 // Verifies the type of a MATCHER*.
1097 // Tests that matcher-typed parameters can be used in Value() inside a
1168 Matcher<const int (&)[2]> m = Contains(2);
1182 Matcher<vector<int> > m = Contains(1);
1185 Matcher<vector<int> > m2 = Not(m);
1263 // The matcher must be in the same namespace as AllOf/AnyOf to make argument
1265 MATCHER(M, "") { return true; }