Home | History | Annotate | Download | only in test

Lines Matching defs:MATCHER

69 using testing::Matcher;
82 // Returns the description of the given matcher.
84 string Describe(const Matcher<T>& m) {
90 // Returns the description of the negation of the given matcher.
92 string DescribeNegation(const Matcher<T>& m) {
141 // The MATCHER*() macros trigger warning C4100 (unreferenced formal
151 MATCHER(SumIsZero, "") {
168 const Matcher<Tuple3> m = Args<1, 2>(Lt());
175 const Matcher<const Tuple3&> m = Args<0, 1>(Lt());
195 const Matcher<tuple<int, bool, char> > m = Args<2, 0>(Lt());
202 const Matcher<const tuple<int, bool, char, int>&> m =
210 const Matcher<tuple<int, char> > m = Args<1, 0>(Gt());
217 const Matcher<tuple<bool, int, int> > m = Args<1, 2>(Eq());
240 Matcher<tuple<char, int> > LessThan() {
245 const Matcher<tuple<char, int, int> > m = Args<0, 2>(LessThan());
280 Matcher<int> GreaterThan(int n) {
290 Matcher<const vector<int>&> m = ElementsAre();
295 Matcher<vector<int> > m = ElementsAre(Gt(5));
300 Matcher<list<string> > m = ElementsAre(StrEq("one"), "two");
307 Matcher<vector<int> > m = ElementsAre();
312 Matcher<const list<int>& > m = ElementsAre(Gt(5));
318 Matcher<const list<string>& > m = ElementsAre("one", "two");
325 Matcher<const list<int>& > m = ElementsAre(1, Ne(2));
334 Matcher<const vector<int>& > m =
345 Matcher<const list<int>& > m = ElementsAre(1, 3);
356 Matcher<const vector<int>& > m = ElementsAre(1, GreaterThan(5));
436 Matcher<vector<string> > m = ElementsAre(StrEq("test string"));
444 Matcher<vector<string> > m = ElementsAre(StrEq("test string"));
454 Matcher<vector<string> > m = ElementsAre(
566 const Matcher<string> kMatcherArray[] =
590 // Tests for the MATCHER*() macro family.
592 // Tests that a simple MATCHER() definition works.
594 MATCHER(IsEven, "") { return (arg % 2) == 0; }
597 const Matcher<int> m = IsEven();
608 MATCHER(IsEven2, negation ? "is odd" : "is even") {
611 // supplied by the MATCHER macro implicitly.
620 // This also tests that the description string can reference matcher
638 // Tests that the matcher description can reference 'negation' and the
639 // matcher parameters.
641 const Matcher<int> m1 = IsEven2();
645 const Matcher<int> m2 = EqSumOf(5, 9);
650 // Tests explaining match result in a MATCHER* macro.
652 const Matcher<int> m1 = IsEven2();
656 const Matcher<int> m2 = EqSumOf(1, 2);
661 // Tests that the body of MATCHER() can reference the type of the
664 MATCHER(IsEmptyString, "") {
669 MATCHER(IsEmptyStringByRef, "") {
675 const Matcher< ::std::string> m1 = IsEmptyString();
678 const Matcher<const ::std::string&> m2 = IsEmptyStringByRef();
682 // Tests that MATCHER() can be used in a namespace.
685 MATCHER(IsOdd, "") { return (arg % 2) != 0; }
689 Matcher<int> m = matcher_test::IsOdd();
695 MATCHER(IsPositiveOdd, "") {
710 const Matcher<int> m = IsGreaterThan32And(5);
720 // Tests that the description is calculated correctly from the matcher name.
724 const Matcher<int> m = _is_Greater_Than32and_(5);
732 // Tests that a MATCHER_P matcher can be explicitly instantiated with
749 const Matcher<const UncopyableFoo&> m =
777 // Tests that a MATCHER_Pn matcher can be explicitly instantiated with
786 const Matcher<const UncopyableFoo&> m =
797 const Matcher<const UncopyableFoo&> m =
813 const Matcher<const long&> m = IsNotInClosedRange(10, 20); // NOLINT
823 // Tests that MATCHER*() definitions can be overloaded on the number
826 MATCHER(EqualsSumOf, "") { return arg == 0; }
901 // Tests that the matcher body can promote the parameter types.
911 Matcher<std::string> no_promo =
913 Matcher<const std::string&> promo =
921 // Verifies the type of a MATCHER*.
949 // Tests that matcher-typed parameters can be used in Value() inside a
1020 Matcher<const int(&)[2]> m = Contains(2);
1034 Matcher<vector<int> > m = Contains(1);
1037 Matcher<vector<int> > m2 = Not(m);
1115 // The matcher must be in the same namespace as AllOf/AnyOf to make argument
1117 MATCHER(M, "") { return true; }