Lines Matching full:matches
101 using testing::Matches;
196 // Returns the reason why x matches, or doesn't match, m.
275 EXPECT_TRUE(m.Matches(2));
276 EXPECT_FALSE(m.Matches(3));
290 EXPECT_TRUE(m.Matches(4));
291 EXPECT_FALSE(m.Matches(5));
297 EXPECT_TRUE(m1.Matches(5));
298 EXPECT_FALSE(m1.Matches(6));
304 EXPECT_TRUE(m1.Matches(NULL));
306 EXPECT_FALSE(m1.Matches(&n));
313 EXPECT_TRUE(m1.Matches(false));
314 EXPECT_FALSE(m1.Matches(true));
318 EXPECT_TRUE(m1.Matches(true));
319 EXPECT_FALSE(m1.Matches(false));
345 EXPECT_TRUE(m1.Matches("hi"));
346 EXPECT_FALSE(m1.Matches("hello"));
349 EXPECT_TRUE(m2.Matches("hi"));
350 EXPECT_FALSE(m2.Matches("hello"));
357 EXPECT_TRUE(m1.Matches("hi"));
358 EXPECT_FALSE(m1.Matches("hello"));
361 EXPECT_TRUE(m2.Matches("hi"));
362 EXPECT_FALSE(m2.Matches("hello"));
401 EXPECT_TRUE(m1.Matches(0));
403 EXPECT_TRUE(m1.Matches(g_bar));
404 EXPECT_FALSE(m1.Matches(1));
409 EXPECT_TRUE(m2.Matches(0.0));
410 EXPECT_FALSE(m2.Matches(0.1));
444 EXPECT_TRUE(m1.Matches(42));
445 EXPECT_FALSE(m1.Matches(43));
455 EXPECT_TRUE(m2.Matches('\x42'));
456 EXPECT_FALSE(m2.Matches('\x43'));
468 EXPECT_TRUE(m.Matches(5));
469 EXPECT_FALSE(m.Matches(6));
494 EXPECT_TRUE(m2.Matches(2));
495 EXPECT_FALSE(m2.Matches(3));
502 EXPECT_TRUE(m4.Matches(1));
503 EXPECT_FALSE(m4.Matches(0));
510 EXPECT_TRUE(m2.Matches(0));
511 EXPECT_FALSE(m2.Matches(1));
518 EXPECT_TRUE(m2.Matches(0));
519 EXPECT_FALSE(m2.Matches(1));
526 EXPECT_TRUE(m2.Matches(0));
527 EXPECT_FALSE(m2.Matches(1));
535 EXPECT_TRUE(m2.Matches(n));
537 EXPECT_FALSE(m2.Matches(n));
544 EXPECT_TRUE(m2.Matches(0));
545 EXPECT_FALSE(m2.Matches(1));
568 EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
569 EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
575 EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
576 EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
585 EXPECT_TRUE(m2.Matches(' '));
586 EXPECT_FALSE(m2.Matches('\n'));
595 EXPECT_TRUE(m2.Matches(1.0f));
596 EXPECT_FALSE(m2.Matches(2.0f));
599 EXPECT_TRUE(m3.Matches('a'));
600 EXPECT_FALSE(m3.Matches('b'));
609 EXPECT_TRUE(m2.Matches(&d));
610 EXPECT_FALSE(m2.Matches(&d2));
614 EXPECT_TRUE(m4.Matches(d));
615 EXPECT_FALSE(m4.Matches(d2));
624 EXPECT_TRUE(m2.Matches(n));
625 EXPECT_FALSE(m2.Matches(n1));
632 EXPECT_TRUE(m2.Matches(0));
633 EXPECT_FALSE(m2.Matches(1));
641 EXPECT_TRUE(m2.Matches(n));
643 EXPECT_FALSE(m2.Matches(n));
650 EXPECT_TRUE(m2.Matches(0));
651 EXPECT_FALSE(m2.Matches(1));
656 EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
657 EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
663 EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
664 EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
667 // Tests that A<T>() matches any value of type T.
671 EXPECT_TRUE(m1.Matches(91.43));
672 EXPECT_TRUE(m1.Matches(-15.32));
678 EXPECT_TRUE(m2.Matches(a));
679 EXPECT_TRUE(m2.Matches(b));
687 // Tests that An<T>() matches any value of type T.
691 EXPECT_TRUE(m1.Matches(9143));
692 EXPECT_TRUE(m1.Matches(-1532));
698 EXPECT_TRUE(m2.Matches(a));
699 EXPECT_TRUE(m2.Matches(b));
707 // Tests that _ can be used as a matcher for any type and matches any
712 EXPECT_TRUE(m1.Matches(123));
713 EXPECT_TRUE(m1.Matches(-242));
719 EXPECT_TRUE(m2.Matches(a));
720 EXPECT_TRUE(m2.Matches(b));
729 // Tests that Eq(x) matches any value equal to x.
736 EXPECT_TRUE(m1.Matches(a1));
737 EXPECT_FALSE(m1.Matches(a2));
760 EXPECT_TRUE(m1.Matches(1));
761 EXPECT_FALSE(m1.Matches(2));
764 EXPECT_TRUE(m2.Matches('\1'));
765 EXPECT_FALSE(m2.Matches('a'));
768 // Tests that TypedEq<T>(v) matches values of type T that's equal to v.
771 EXPECT_TRUE(m1.Matches('a'));
772 EXPECT_FALSE(m1.Matches('b'));
775 EXPECT_TRUE(m2.Matches(6));
776 EXPECT_FALSE(m2.Matches(7));
804 // Tests that Ge(v) matches anything >= v.
807 EXPECT_TRUE(m1.Matches(1));
808 EXPECT_TRUE(m1.Matches(0));
809 EXPECT_FALSE(m1.Matches(-1));
818 // Tests that Gt(v) matches anything > v.
821 EXPECT_TRUE(m1.Matches(1.0));
822 EXPECT_FALSE(m1.Matches(0.0));
823 EXPECT_FALSE(m1.Matches(-1.0));
832 // Tests that Le(v) matches anything <= v.
835 EXPECT_TRUE(m1.Matches('a'));
836 EXPECT_TRUE(m1.Matches('b'));
837 EXPECT_FALSE(m1.Matches('c'));
846 // Tests that Lt(v) matches anything < v.
849 EXPECT_TRUE(m1.Matches("Abc"));
850 EXPECT_FALSE(m1.Matches("Hello"));
851 EXPECT_FALSE(m1.Matches("Hello, world!"));
860 // Tests that Ne(v) matches anything != v.
863 EXPECT_TRUE(m1.Matches(1));
864 EXPECT_TRUE(m1.Matches(-1));
865 EXPECT_FALSE(m1.Matches(0));
874 // Tests that IsNull() matches any NULL pointer of any type.
879 EXPECT_TRUE(m1.Matches(p1));
880 EXPECT_FALSE(m1.Matches(&n));
884 EXPECT_TRUE(m2.Matches(p2));
885 EXPECT_FALSE(m2.Matches("hi"));
898 EXPECT_TRUE(m3.Matches(p3));
899 EXPECT_FALSE(m3.Matches(reinterpret_cast<void*>(0xbeef)));
908 EXPECT_TRUE(m.Matches(null_p));
909 EXPECT_FALSE(m.Matches(non_null_p));
917 EXPECT_TRUE(m.Matches(null_p));
918 EXPECT_FALSE(m.Matches(non_null_p));
926 EXPECT_TRUE(m.Matches(null_p));
927 EXPECT_FALSE(m.Matches(non_null_p));
937 // Tests that NotNull() matches any non-NULL pointer of any type.
942 EXPECT_FALSE(m1.Matches(p1));
943 EXPECT_TRUE(m1.Matches(&n));
947 EXPECT_FALSE(m2.Matches(p2));
948 EXPECT_TRUE(m2.Matches("hi"));
956 EXPECT_FALSE(m.Matches(null_p));
957 EXPECT_TRUE(m.Matches(non_null_p));
965 EXPECT_FALSE(m.Matches(null_p));
966 EXPECT_TRUE(m.Matches(non_null_p));
974 EXPECT_FALSE(m.Matches(null_p));
975 EXPECT_TRUE(m.Matches(non_null_p));
984 // Tests that Ref(variable) matches an argument that references
990 EXPECT_TRUE(m.Matches(a));
991 EXPECT_FALSE(m.Matches(b));
1009 EXPECT_TRUE(m.Matches(a));
1010 EXPECT_FALSE(m.Matches(b));
1021 EXPECT_TRUE(m1.Matches(base));
1022 EXPECT_FALSE(m1.Matches(base2));
1023 EXPECT_FALSE(m1.Matches(derived));
1026 EXPECT_TRUE(m1.Matches(derived));
1027 EXPECT_FALSE(m1.Matches(base));
1028 EXPECT_FALSE(m1.Matches(base2));
1045 EXPECT_TRUE(m.Matches("Hello"));
1046 EXPECT_FALSE(m.Matches("hello"));
1047 EXPECT_FALSE(m.Matches(NULL));
1050 EXPECT_TRUE(m2.Matches("Hello"));
1051 EXPECT_FALSE(m2.Matches("Hi"));
1070 EXPECT_TRUE(m.Matches(""));
1071 EXPECT_TRUE(m.Matches(NULL));
1072 EXPECT_FALSE(m.Matches("Hello"));
1075 EXPECT_TRUE(m2.Matches("hello"));
1076 EXPECT_FALSE(m2.Matches("Hello"));
1086 EXPECT_TRUE(m.Matches("Hello"));
1087 EXPECT_TRUE(m.Matches("hello"));
1088 EXPECT_FALSE(m.Matches("Hi"));
1089 EXPECT_FALSE(m.Matches(NULL));
1092 EXPECT_TRUE(m2.Matches("hello"));
1093 EXPECT_FALSE(m2.Matches("Hi"));
1100 EXPECT_FALSE(m0.Matches(str2 + string(1, '\0')));
1104 Matches(str2));
1110 EXPECT_FALSE(m2.Matches(str2));
1113 EXPECT_TRUE(m3.Matches(str2));
1115 EXPECT_FALSE(m3.Matches(str2 + "x"));
1117 EXPECT_FALSE(m3.Matches(str2));
1118 EXPECT_FALSE(m3.Matches(string(str2, 0, 9)));
1128 EXPECT_TRUE(m.Matches("Hi"));
1129 EXPECT_TRUE(m.Matches(NULL));
1130 EXPECT_FALSE(m.Matches("Hello"));
1131 EXPECT_FALSE(m.Matches("hello"));
1134 EXPECT_TRUE(m2.Matches(""));
1135 EXPECT_FALSE(m2.Matches("Hello"));
1146 EXPECT_TRUE(m1.Matches(string("I love food.")));
1147 EXPECT_FALSE(m1.Matches(string("tofo")));
1150 EXPECT_TRUE(m2.Matches(std::string("I love food.")));
1151 EXPECT_FALSE(m2.Matches(std::string("tofo")));
1157 EXPECT_TRUE(m1.Matches(const_cast<char*>("I love food.")));
1158 EXPECT_FALSE(m1.Matches(const_cast<char*>("tofo")));
1159 EXPECT_FALSE(m1.Matches(NULL));
1162 EXPECT_TRUE(m2.Matches("I love food."));
1163 EXPECT_FALSE(m2.Matches("tofo"));
1164 EXPECT_FALSE(m2.Matches(NULL));
1254 // If neither field matches, Pair() should explain about the first
1260 // If the first field matches but the second doesn't, Pair() should
1298 // 'first' doesnt' match, but 'second' matches.
1302 // 'first' matches, but 'second' doesn't match.
1306 // Neither field matches.
1336 EXPECT_TRUE(m1.Matches("Hi"));
1337 EXPECT_TRUE(m1.Matches(""));
1338 EXPECT_FALSE(m1.Matches(NULL));
1341 EXPECT_TRUE(m2.Matches("Hi"));
1342 EXPECT_TRUE(m2.Matches("Hi Hi!"));
1343 EXPECT_TRUE(m2.Matches("High"));
1344 EXPECT_FALSE(m2.Matches("H"));
1345 EXPECT_FALSE(m2.Matches(" Hi"));
1357 EXPECT_TRUE(m1.Matches("Hi"));
1358 EXPECT_TRUE(m1.Matches(""));
1359 EXPECT_FALSE(m1.Matches(NULL));
1362 EXPECT_TRUE(m2.Matches("Hi"));
1363 EXPECT_TRUE(m2.Matches("Wow Hi Hi"));
1364 EXPECT_TRUE(m2.Matches("Super Hi"));
1365 EXPECT_FALSE(m2.Matches("i"));
1366 EXPECT_FALSE(m2.Matches("Hi "));
1378 EXPECT_TRUE(m1.Matches("az"));
1379 EXPECT_TRUE(m1.Matches("abcz"));
1380 EXPECT_FALSE(m1.Matches(NULL));
1383 EXPECT_TRUE(m2.Matches("azbz"));
1384 EXPECT_FALSE(m2.Matches("az1"));
1385 EXPECT_FALSE(m2.Matches("1az"));
1390 EXPECT_EQ("matches regular expression \"Hi.*\"", Describe(m1));
1393 EXPECT_EQ("matches regular expression \"a.*\"", Describe(m2));
1400 EXPECT_TRUE(m1.Matches("az"));
1401 EXPECT_TRUE(m1.Matches("0abcz1"));
1402 EXPECT_FALSE(m1.Matches(NULL));
1405 EXPECT_TRUE(m2.Matches("azbz"));
1406 EXPECT_TRUE(m2.Matches("az1"));
1407 EXPECT_FALSE(m2.Matches("1a"));
1422 EXPECT_TRUE(m.Matches(L"Hello"));
1423 EXPECT_FALSE(m.Matches(L"hello"));
1424 EXPECT_FALSE(m.Matches(NULL));
1427 EXPECT_TRUE(m2.Matches(L"Hello"));
1428 EXPECT_FALSE(m2.Matches(L"Hi"));
1431 EXPECT_TRUE(m3.Matches(L"\xD3\x576\x8D3\xC74D"));
1432 EXPECT_FALSE(m3.Matches(L"\xD3\x576\x8D3\xC74E"));
1437 EXPECT_TRUE(m4.Matches(str));
1440 EXPECT_TRUE(m5.Matches(str));
1463 EXPECT_TRUE(m.Matches(L""));
1464 EXPECT_TRUE(m.Matches(NULL));
1465 EXPECT_FALSE(m.Matches(L"Hello"));
1468 EXPECT_TRUE(m2.Matches(L"hello"));
1469 EXPECT_FALSE(m2.Matches(L"Hello"));
1479 EXPECT_TRUE(m.Matches(L"Hello"));
1480 EXPECT_TRUE(m.Matches(L"hello"));
1481 EXPECT_FALSE(m.Matches(L"Hi"));
1482 EXPECT_FALSE(m.Matches(NULL));
1485 EXPECT_TRUE(m2.Matches(L"hello"));
1486 EXPECT_FALSE(m2.Matches(L"Hi"));
1493 EXPECT_FALSE(m0.Matches(str2 + ::std::wstring(1, L'\0')));
1497 EXPECT_TRUE(m1.Matches(str2));
1503 EXPECT_FALSE(m2.Matches(str2));
1506 EXPECT_TRUE(m3.Matches(str2));
1508 EXPECT_FALSE(m3.Matches(str2 + L"x"));
1510 EXPECT_FALSE(m3.Matches(str2));
1511 EXPECT_FALSE(m3.Matches(::std::wstring(str2, 0, 9)));
1521 EXPECT_TRUE(m.Matches(L"Hi"));
1522 EXPECT_TRUE(m.Matches(NULL));
1523 EXPECT_FALSE(m.Matches(L"Hello"));
1524 EXPECT_FALSE(m.Matches(L"hello"));
1527 EXPECT_TRUE(m2.Matches(L""));
1528 EXPECT_FALSE(m2.Matches(L"Hello"));
1539 EXPECT_TRUE(m1.Matches(::std::wstring(L"I love food.")));
1540 EXPECT_FALSE(m1.Matches(::std::wstring(L"tofo")));
1543 EXPECT_TRUE(m2.Matches(::std::wstring(L"I love food.")));
1544 EXPECT_FALSE(m2.Matches(::std::wstring(L"tofo")));
1550 EXPECT_TRUE(m1.Matches(const_cast<wchar_t*>(L"I love food.")));
1551 EXPECT_FALSE(m1.Matches(const_cast<wchar_t*>(L"tofo")));
1552 EXPECT_FALSE(m1.Matches(NULL));
1555 EXPECT_TRUE(m2.Matches(L"I love food."));
1556 EXPECT_FALSE(m2.Matches(L"tofo"));
1557 EXPECT_FALSE(m2.Matches(NULL));
1570 EXPECT_TRUE(m1.Matches(L"Hi"));
1571 EXPECT_TRUE(m1.Matches(L""));
1572 EXPECT_FALSE(m1.Matches(NULL));
1575 EXPECT_TRUE(m2.Matches(L"Hi"));
1576 EXPECT_TRUE(m2.Matches(L"Hi Hi!"));
1577 EXPECT_TRUE(m2.Matches(L"High"));
1578 EXPECT_FALSE(m2.Matches
1579 EXPECT_FALSE(m2.Matches(L" Hi"));
1591 EXPECT_TRUE(m1.Matches(L"Hi"));
1592 EXPECT_TRUE(m1.Matches(L""));
1593 EXPECT_FALSE(m1.Matches(NULL));
1596 EXPECT_TRUE(m2.Matches(L"Hi"));
1597 EXPECT_TRUE(m2.Matches(L"Wow Hi Hi"));
1598 EXPECT_TRUE(m2.Matches(L"Super Hi"));
1599 EXPECT_FALSE(m2.Matches(L"i"));
1600 EXPECT_FALSE(m2.Matches(L"Hi "));
1613 EXPECT_TRUE(m.Matches(L"Hello"));
1614 EXPECT_FALSE(m.Matches(L"hello"));
1615 EXPECT_FALSE(m.Matches(NULL));
1618 EXPECT_TRUE(m2.Matches(L"Hello"));
1619 EXPECT_FALSE(m2.Matches(L"Hi"));
1622 EXPECT_TRUE(m3.Matches(L"\xD3\x576\x8D3\xC74D"));
1623 EXPECT_FALSE(m3.Matches(L"\xD3\x576\x8D3\xC74E"));
1628 EXPECT_TRUE(m4.Matches(str));
1631 EXPECT_TRUE(m5.Matches(str));
1654 EXPECT_TRUE(m.Matches(L""));
1655 EXPECT_TRUE(m.Matches(NULL));
1656 EXPECT_FALSE(m.Matches(L"Hello"));
1659 EXPECT_TRUE(m2.Matches(L"hello"));
1660 EXPECT_FALSE(m2.Matches(L"Hello"));
1670 EXPECT_TRUE(m.Matches(L"Hello"));
1671 EXPECT_TRUE(m.Matches(L"hello"));
1672 EXPECT_FALSE(m.Matches(L"Hi"));
1673 EXPECT_FALSE(m.Matches(NULL));
1676 EXPECT_TRUE(m2.Matches(L"hello"));
1677 EXPECT_FALSE(m2.Matches(L"Hi"));
1684 EXPECT_FALSE(m0.Matches(str2 + ::wstring(1, L'\0')));
1688 EXPECT_TRUE(m1.Matches(str2));
1694 EXPECT_FALSE(m2.Matches(str2));
1697 EXPECT_TRUE(m3.Matches(str2));
1699 EXPECT_FALSE(m3.Matches(str2 + L"x"));
1701 EXPECT_FALSE(m3.Matches(str2));
1702 EXPECT_FALSE(m3.Matches(::wstring(str2, 0, 9)));
1712 EXPECT_TRUE(m.Matches(L"Hi"));
1713 EXPECT_TRUE(m.Matches(NULL));
1714 EXPECT_FALSE(m.Matches(L"Hello"));
1715 EXPECT_FALSE(m.Matches(L"hello"));
1718 EXPECT_TRUE(m2.Matches(L""));
1719 EXPECT_FALSE(m2.Matches(L"Hello"));
1730 EXPECT_TRUE(m1.Matches(::wstring(L"I love food.")));
1731 EXPECT_FALSE(m1.Matches(::wstring(L"tofo")));
1734 EXPECT_TRUE(m2.Matches(::wstring(L"I love food.")));
1735 EXPECT_FALSE(m2.Matches(::wstring(L"tofo")));
1741 EXPECT_TRUE(m1.Matches(const_cast<wchar_t*>(L"I love food.")));
1742 EXPECT_FALSE(m1.Matches(const_cast<wchar_t*>(L"tofo")));
1743 EXPECT_FALSE(m1.Matches(NULL));
1746 EXPECT_TRUE(m2.Matches(L"I love food."));
1747 EXPECT_FALSE(m2.Matches(L"tofo"));
1748 EXPECT_FALSE(m2.Matches(NULL));
1761 EXPECT_TRUE(m1.Matches(L"Hi"));
1762 EXPECT_TRUE(m1.Matches(L""));
1763 EXPECT_FALSE(m1.Matches(NULL));
1766 EXPECT_TRUE(m2.Matches(L"Hi"));
1767 EXPECT_TRUE(m2.Matches(L"Hi Hi!"));
1768 EXPECT_TRUE(m2.Matches(L"High"));
1769 EXPECT_FALSE(m2.Matches(L"H"));
1770 EXPECT_FALSE(m2.Matches(L" Hi"));
1782 EXPECT_TRUE(m1.Matches(L"Hi"));
1783 EXPECT_TRUE(m1.Matches(L""));
1784 EXPECT_FALSE(m1.Matches(NULL));
1787 EXPECT_TRUE(m2.Matches(L"Hi"));
1788 EXPECT_TRUE(m2.Matches(L"Wow Hi Hi"));
1789 EXPECT_TRUE(m2.Matches(L"Super Hi"));
1790 EXPECT_FALSE(m2.Matches(L"i"));
1791 EXPECT_FALSE(m2.Matches(L"Hi "));
1804 // Tests that Eq() matches a 2-tuple where the first field == the
1808 EXPECT_TRUE(m.Matches(Tuple2(5L, 5)));
1809 EXPECT_FALSE(m.Matches(Tuple2(5L, 6)));
1818 // Tests that Ge() matches a 2-tuple where the first field >= the
1822 EXPECT_TRUE(m.Matches(Tuple2(5L, 4)));
1823 EXPECT_TRUE(m.Matches(Tuple2(5L, 5)));
1824 EXPECT_FALSE(m.Matches(Tuple2(5L, 6)));
1833 // Tests that Gt() matches a 2-tuple where the first field > the
1837 EXPECT_TRUE(m.Matches(Tuple2(5L, 4)));
1838 EXPECT_FALSE(m.Matches(Tuple2(5L, 5)));
1839 EXPECT_FALSE(m.Matches(Tuple2(5L, 6)));
1848 // Tests that Le() matches a 2-tuple where the first field <= the
1852 EXPECT_TRUE(m.Matches(Tuple2(5L, 6)));
1853 EXPECT_TRUE(m.Matches(Tuple2(5L, 5)));
1854 EXPECT_FALSE(m.Matches(Tuple2(5L, 4)));
1863 // Tests that Lt() matches a 2-tuple where the first field < the
1867 EXPECT_TRUE(m.Matches(Tuple2(5L, 6)));
1868 EXPECT_FALSE(m.Matches(Tuple2(5L, 5)));
1869 EXPECT_FALSE(m.Matches(Tuple2(5L, 4)));
1878 // Tests that Ne() matches a 2-tuple where the first field != the
1882 EXPECT_TRUE(m.Matches(Tuple2(5L, 6)));
1883 EXPECT_TRUE(m.Matches(Tuple2(5L, 4)));
1884 EXPECT_FALSE(m.Matches(Tuple2(5L, 5)));
1893 // Tests that Not(m) matches any value that doesn't match m.
1897 EXPECT_TRUE(m.Matches(3));
1898 EXPECT_FALSE(m.Matches(2));
1920 EXPECT_TRUE(m.Matches(0));
1922 EXPECT_FALSE(m.Matches(i));
1924 EXPECT_TRUE(m.Matches(num + 1));
1927 // Tests that AllOf(m1, ..., mn) matches any value that matches all of
1932 EXPECT_TRUE(m.Matches(1));
1933 EXPECT_TRUE(m.Matches(2));
1934 EXPECT_FALSE(m.Matches(0));
1935 EXPECT_FALSE(m.Matches(3));
1938 EXPECT_TRUE(m.Matches(3));
1939 EXPECT_FALSE(m.Matches(2));
1940 EXPECT_FALSE(m.Matches(1));
1941 EXPECT_FALSE(m.Matches(0));
1944 EXPECT_TRUE(m.Matches(4));
1945 EXPECT_FALSE(m.Matches(3));
1946 EXPECT_FALSE(m.Matches(2));
1947 EXPECT_FALSE(m.Matches(1));
1948 EXPECT_FALSE(m.Matches(0));
1951 EXPECT_TRUE(m.Matches(0));
1952 EXPECT_TRUE(m.Matches(1));
1953 EXPECT_FALSE(m.Matches(3));
2096 EXPECT_FALSE(m.Matches(0));
2098 EXPECT_TRUE(m.Matches(i));
2100 EXPECT_FALSE(m.Matches(num + 1));
2103 // Tests that AnyOf(m1, ..., mn) matches any value that matches at
2108 EXPECT_TRUE(m.Matches(1));
2109 EXPECT_TRUE(m.Matches(4));
2110 EXPECT_FALSE(m.Matches(2));
2113 EXPECT_TRUE(m.Matches(-1));
2114 EXPECT_TRUE(m.Matches(1));
2115 EXPECT_TRUE(m.Matches(2));
2116 EXPECT_FALSE(m.Matches(0));
2119 EXPECT_TRUE(m.Matches(-1));
2120 EXPECT_TRUE(m.Matches(1));
2121 EXPECT_TRUE(m.Matches(2));
2122 EXPECT_TRUE(m.Matches(3));
2123 EXPECT_FALSE(m.Matches(0));
2126 EXPECT_TRUE(m.Matches(0));
2127 EXPECT_TRUE(m.Matches(11));
2128 EXPECT_TRUE(m.Matches(3));
2129 EXPECT_FALSE(m.Matches(2));
2292 // Tests that Truly(predicate) matches what satisfies the given
2296 EXPECT_TRUE(m.Matches(2.0));
2297 EXPECT_FALSE(m.Matches(-1.5));
2303 EXPECT_TRUE(m.Matches(6));
2304 EXPECT_FALSE(m.Matches(4));
2326 EXPECT_TRUE(m.Matches(1));
2327 EXPECT_FALSE(m.Matches(0));
2341 EXPECT_TRUE(m.Matches(foo));
2343 EXPECT_FALSE(m.Matches(n));
2346 // Tests that Matches(m) is a predicate satisfied by whatever that
2347 // matches matcher m.
2349 EXPECT_TRUE(Matches(Ge(0))(1));
2350 EXPECT_FALSE(Matches(Eq('a'))('b'));
2353 // Tests that Matches(m) works when the matcher takes its argument by
2357 EXPECT_TRUE(Matches(AllOf(Ref(n), Eq(0)))(n));
2358 EXPECT_FALSE(Matches(Ref(m))(n));
2362 // Matches().
2365 EXPECT_TRUE(Matches(eq5)(5));
2366 EXPECT_FALSE(Matches(eq5)(2));
2370 // Matches(), which has been tested already, we don't spend a lot of
2453 // matches the matcher.
2582 // A battery of tests for FloatingEqMatcher::Matches.
2587 EXPECT_TRUE(m1.Matches(-0.0));
2588 EXPECT_TRUE(m1.Matches(close_to_positive_zero_));
2589 EXPECT_TRUE(m1.Matches(close_to_negative_zero_));
2590 EXPECT_FALSE(m1.Matches(1.0));
2593 EXPECT_FALSE(m2.Matches(further_from_negative_zero_));
2596 EXPECT_TRUE(m3.Matches(close_to_one_));
2597 EXPECT_FALSE(m3.Matches(further_from_one_));
2599 // Test commutativity: matcher_maker(0.0).Matches(1.0) was tested above.
2600 EXPECT_FALSE(m3.Matches(0.0));
2603 EXPECT_TRUE(m4.Matches(-close_to_infinity_));
2606 EXPECT_TRUE(m5.Matches(close_to_infinity_));
2610 EXPECT_FALSE(m5.Matches(nan1_));
2615 EXPECT_TRUE(m6.Matches(-0.0));
2616 EXPECT_TRUE(m6.Matches(close_to_positive_zero_));
2617 EXPECT_FALSE(m6.Matches(1.0));
2623 EXPECT_TRUE(m7.Matches(x));
2625 EXPECT_FALSE(m7.Matches(x));
2687 // FloatEq never matches NaN.
2689 EXPECT_FALSE(m.Matches(nan1_));
2690 EXPECT_FALSE(m.Matches(nan2_));
2691 EXPECT_FALSE(m.Matches(1.0));
2697 EXPECT_TRUE(m.Matches(nan1_));
2698 EXPECT_TRUE(m.Matches(nan2_));
2699 EXPECT_FALSE(m.Matches(1.0));
2712 EXPECT_EQ("never matches", Describe(m3));
2742 // DoubleEq never matches NaN.
2744 EXPECT_FALSE(m.Matches(nan1_));
2745 EXPECT_FALSE(m.Matches(nan2_));
2746 EXPECT_FALSE(m.Matches(1.0));
2752 EXPECT_TRUE(m.Matches(nan1_));
2753 EXPECT_TRUE(m.Matches(nan2_));
2754 EXPECT_FALSE(m.Matches(1.0));
2767 EXPECT_EQ("never matches", Describe(m3));
2789 EXPECT_TRUE(m.Matches(&n));
2791 EXPECT_FALSE(m.Matches(&n));
2792 EXPECT_FALSE(m.Matches(NULL));
2799 EXPECT_TRUE(m.Matches(&x));
2801 EXPECT_FALSE(m.Matches(&x));
2802 EXPECT_FALSE(m.Matches(NULL));
2809 EXPECT_TRUE(m.Matches(&n));
2811 EXPECT_FALSE(m.Matches(&n));
2812 EXPECT_FALSE(m.Matches(NULL));
2820 EXPECT_TRUE(m.Matches(p));
2822 EXPECT_FALSE(m.Matches(p));
2824 EXPECT_FALSE(m.Matches(p));
2852 EXPECT_TRUE(m.Matches(o));
2853 EXPECT_TRUE(m.Matches(co));
2855 EXPECT_FALSE(m.Matches(o));
2856 EXPECT_FALSE(m.Matches(ConstPropagatingPtr<int>()));
2861 EXPECT_FALSE(m.Matches(NULL));
2869 EXPECT_TRUE(m.Matches(&n));
2871 EXPECT_FALSE(m.Matches(&n));
2872 EXPECT_FALSE(m.Matches(NULL));
2941 EXPECT_TRUE(m.Matches(a));
2943 EXPECT_FALSE(m.Matches(a));
2951 EXPECT_TRUE(m.Matches(a));
2953 EXPECT_FALSE(m.Matches(a));
2961 EXPECT_TRUE(m.Matches(a));
2963 EXPECT_FALSE(m.Matches(a));
2971 EXPECT_TRUE(m.Matches(a));
2973 EXPECT_FALSE(m.Matches(a));
2978 EXPECT_TRUE(m.Matches(a));
2980 EXPECT_FALSE(m.Matches(a));
2988 EXPECT_TRUE(m.Matches(a));
2990 EXPECT_FALSE(m.Matches(a));
3001 EXPECT_TRUE(m.Matches(d));
3003 EXPECT_FALSE(m.Matches(d));
3014 EXPECT_TRUE(m.Matches(a));
3016 EXPECT_FALSE(m.Matches(a));
3046 EXPECT_TRUE(m.Matches(&a));
3048 EXPECT_FALSE(m.Matches(&a));
3056 EXPECT_TRUE(m.Matches(&a));
3058 EXPECT_FALSE(m.Matches(&a));
3066 EXPECT_TRUE(m.Matches(&a));
3068 EXPECT_FALSE(m.Matches(&a));
3074 EXPECT_FALSE(m.Matches(NULL));
3085 EXPECT_TRUE(m.Matches(&d));
3087 EXPECT_FALSE(m.Matches(&d));
3152 EXPECT_TRUE(m.Matches(a));
3155 EXPECT_FALSE(m.Matches(a));
3165 EXPECT_TRUE(m.Matches(a));
3168 EXPECT_FALSE(m.Matches(a));
3178 EXPECT_FALSE(m.Matches(a));
3181 EXPECT_TRUE(m.Matches(a));
3191 EXPECT_TRUE(m.Matches(a));
3194 EXPECT_FALSE(m.Matches(a));
3206 EXPECT_TRUE(m.Matches(d));
3209 EXPECT_FALSE(m.Matches(d));
3220 EXPECT_TRUE(m.Matches(a));
3222 EXPECT_FALSE(m.Matches(a));
3254 EXPECT_TRUE(m.Matches(&a));
3257 EXPECT_FALSE(m.Matches(&a));
3266 EXPECT_TRUE(m.Matches(&a));
3269 EXPECT_FALSE(m.Matches(&a));
3279 EXPECT_TRUE(m.Matches(&a));
3282 EXPECT_FALSE(m.Matches(&a));
3288 EXPECT_FALSE(m.Matches(NULL));
3300 EXPECT_TRUE(m.Matches(&d));
3303 EXPECT_FALSE(m.Matches(&d));
3341 EXPECT_TRUE(matcher.Matches(1));
3342 EXPECT_FALSE(matcher.Matches(2));
3373 EXPECT_TRUE(matcher.Matches(42));
3374 EXPECT_FALSE(matcher.Matches(36));
3390 EXPECT_TRUE(matcher.Matches(x));
3391 EXPECT_FALSE(matcher.Matches(x2));
3399 EXPECT_TRUE(matcher2.Matches(obj));
3400 EXPECT_FALSE(matcher2.Matches(obj2));
3412 EXPECT_TRUE(matcher.Matches(s));
3413 EXPECT_FALSE(matcher.Matches(s2));
3422 EXPECT_TRUE(matcher.Matches(36));
3423 EXPECT_FALSE(matcher.Matches(42));
3438 EXPECT_TRUE(matcher.Matches(1));
3439 EXPECT_FALSE(matcher.Matches(2));
3453 EXPECT_TRUE(matcher.Matches(1));
3454 EXPECT_FALSE(matcher.Matches(2));
3469 EXPECT_TRUE(matcher_int.Matches(10));
3470 EXPECT_FALSE(matcher_int.Matches(2));
3474 EXPECT_TRUE(matcher_string.Matches("long string"));
3475 EXPECT_FALSE(matcher_string.Matches("shrt"));
3489 EXPECT_TRUE(matcher2.Matches(n));
3490 EXPECT_FALSE(matcher2.Matches(n2));
3493 EXPECT_TRUE(matcher3.Matches(n));
3494 EXPECT_FALSE(matcher3.Matches(n2));
3594 EXPECT_TRUE(m.Matches(n1));
3595 EXPECT_FALSE(m.Matches(n2));
3603 EXPECT_FALSE(m.Matches(n1));
3604 EXPECT_TRUE(m.Matches(n2));
3628 EXPECT_TRUE(m.Matches(my_set));
3639 EXPECT_FALSE(m.Matches(test_set));
3651 EXPECT_FALSE(m.Matches(test_set));
3662 EXPECT_FALSE(m.Matches(test_set));
3689 EXPECT_FALSE(m.Matches(test_set));
3702 EXPECT_FALSE(m.Matches(test_set));
3714 EXPECT_FALSE(m.Matches(test_set));
3728 EXPECT_TRUE(m.Matches(my_set));
3729 EXPECT_FALSE(m.Matches(test_set));
3746 EXPECT_TRUE(m.Matches(my_map));
3747 EXPECT_FALSE(m.Matches(test_map));