Lines Matching +full:use +full:- +full:internal +full:- +full:divider

4 // Redistribution and use in source and binary forms, with or without
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 // Google Mock - a framework for writing C++ mock classes.
40 #include "test/gmock-matchers_test.h"
119 if (listener->stream() != nullptr) {
122 *listener->stream() << " == " << (x % 2);
140 // Tests default-constructing a matcher.
209 EXPECT_FALSE(m.MatchAndExplain(-9, &listener2));
213 // Tests that a C-string literal can be implicitly converted to a
238 // Tests that a C-string literal can be implicitly converted to a
241 Matcher<internal::StringView> m1 = "cats";
245 Matcher<const internal::StringView&> m2 = "cats";
253 Matcher<internal::StringView> m1 = std::string("cats");
257 Matcher<const internal::StringView&> m2 = std::string("cats");
265 Matcher<internal::StringView> m1 = internal::StringView("cats");
269 Matcher<const internal::StringView&> m2 = internal::StringView("cats");
325 // Verifies that the identity of a by-reference argument is preserved.
349 if (listener->stream() != nullptr) {
352 *listener->stream() << " == " << (x % 2);
544 ConvertibleFromAny(const T& /*a_value*/) : value(-1) {
734 EXPECT_TRUE(m1.Matches(-15.32));
738 int b = -6;
761 EXPECT_TRUE(m1.Matches(-1532));
765 int b = -6;
780 EXPECT_TRUE(m1.Matches(-242));
798 // 2 C-strings with same content but different addresses.
814 // -Wunused-private-field: dummy accessor for `c_`.
823 EXPECT_EQ("is equal to 1-byte object <61>", Describe(m));
878 EXPECT_FALSE(m1.Matches(-1));
892 EXPECT_FALSE(m1.Matches(-1.0));
933 EXPECT_TRUE(m1.Matches(-1));
982 helper.Call(MoveOnly(-1));
1046 // Tests that NotNull() matches any non-NULL pointer of any type.
1121 // used wherever Ref(base) can be used (Ref(derived) is a sub-type
1151 std::string FromStringLike(internal::StringLike<T> str) {
1159 EXPECT_EQ("foo", FromStringLike(internal::StringView("foo")));
1180 Matcher<const internal::StringView&> m3 =
1181 StrEq(internal::StringView("Hello"));
1182 EXPECT_TRUE(m3.Matches(internal::StringView("Hello")));
1183 EXPECT_FALSE(m3.Matches(internal::StringView("hello")));
1184 EXPECT_FALSE(m3.Matches(internal::StringView()));
1186 Matcher<const internal::StringView&> m_empty = StrEq("");
1187 EXPECT_TRUE(m_empty.Matches(internal::StringView("")));
1188 EXPECT_TRUE(m_empty.Matches(internal::StringView()));
1189 EXPECT_FALSE(m_empty.Matches(internal::StringView("hello")));
1194 Matcher<std::string> m = StrEq("Hi-\'\"?\\\a\b\f\n\r\t\v\xD3");
1195 EXPECT_EQ("is equal to \"Hi-\'\\\"?\\\\\\a\\b\\f\\n\\r\\t\\v\\xD3\"",
1218 Matcher<const internal::StringView> m3 = StrNe(internal::StringView("Hello"));
1219 EXPECT_TRUE(m3.Matches(internal::StringView("")));
1220 EXPECT_TRUE(m3.Matches(internal::StringView()));
1221 EXPECT_FALSE(m3.Matches(internal::StringView("Hello")));
1242 Matcher<const internal::StringView&> m3 =
1243 StrCaseEq(internal::StringView("Hello"));
1244 EXPECT_TRUE(m3.Matches(internal::StringView("Hello")));
1245 EXPECT_TRUE(m3.Matches(internal::StringView("hello")));
1246 EXPECT_FALSE(m3.Matches(internal::StringView("Hi")));
1247 EXPECT_FALSE(m3.Matches(internal::StringView()));
1293 Matcher<const internal::StringView> m3 =
1294 StrCaseNe(internal::StringView("Hello"));
1295 EXPECT_TRUE(m3.Matches(internal::StringView("Hi")));
1296 EXPECT_TRUE(m3.Matches(internal::StringView()));
1297 EXPECT_FALSE(m3.Matches(internal::StringView("Hello")));
1298 EXPECT_FALSE(m3.Matches(internal::StringView("hello")));
1307 // Tests that HasSubstr() works for matching string-typed values.
1322 // Tests that HasSubstr() works for matching C-string-typed values.
1341 // Tests that HasSubstr() works for matching StringView-typed values.
1343 const Matcher<internal::StringView> m1 =
1344 HasSubstr(internal::StringView("foo"));
1345 EXPECT_TRUE(m1.Matches(internal::StringView("I love food.")));
1346 EXPECT_FALSE(m1.Matches(internal::StringView("tofo")));
1347 EXPECT_FALSE(m1.Matches(internal::StringView()));
1349 const Matcher<const internal::StringView&> m2 = HasSubstr("foo");
1350 EXPECT_TRUE(m2.Matches(internal::StringView("I love food.")));
1351 EXPECT_FALSE(m2.Matches(internal::StringView("tofo")));
1352 EXPECT_FALSE(m2.Matches(internal::StringView()));
1354 const Matcher<const internal::StringView&> m3 = HasSubstr("");
1355 EXPECT_TRUE(m3.Matches(internal::StringView("foo")));
1356 EXPECT_TRUE(m3.Matches(internal::StringView("")));
1357 EXPECT_TRUE(m3.Matches(internal::StringView()));
1411 auto get(const PairWithGet& value) -> decltype(value.GetImpl(Tag<I>())) {
1491 Explain(m, make_pair(-1, -2)));
1496 Explain(m, make_pair(1, -2)));
1501 Explain(m, make_pair(-1, 2)));
1607 Explain(m, std::make_tuple(-1, -2, -3)));
1609 Explain(m, std::make_tuple(1, -2, -3)));
1611 Explain(m, std::make_tuple(1, 2, -3)));
1759 const Matcher<internal::StringView> m_empty =
1760 StartsWith(internal::StringView(""));
1761 EXPECT_TRUE(m_empty.Matches(internal::StringView()));
1762 EXPECT_TRUE(m_empty.Matches(internal::StringView("")));
1763 EXPECT_TRUE(m_empty.Matches(internal::StringView("not empty")));
1774 EXPECT_THAT(internal::StringView("talk to me goose"),
1777 GTEST_SKIP() << "Not applicable without internal::StringView.";
1797 const Matcher<const internal::StringView&> m4 =
1798 EndsWith(internal::StringView(""));
1801 EXPECT_TRUE(m4.Matches(internal::StringView()));
1802 EXPECT_TRUE(m4.Matches(internal::StringView("")));
1818 EXPECT_TRUE(m1.Matches("+/-_IQ")); // \xfb\xff\xbf!
1824 EXPECT_TRUE(m2.Matches("+/-_IQ")); // \xfb\xff\xbf!
1827 const Matcher<const internal::StringView&> m3 =
1832 EXPECT_TRUE(m3.Matches("+/-_IQ")); // \xfb\xff\xbf!
1855 const Matcher<const internal::StringView&> m3 = MatchesRegex("a.*z");
1856 EXPECT_TRUE(m3.Matches(internal::StringView("az")));
1857 EXPECT_TRUE(m3.Matches(internal::StringView("abcz")));
1858 EXPECT_FALSE(m3.Matches(internal::StringView("1az")));
1859 EXPECT_FALSE(m3.Matches(internal::StringView()));
1860 const Matcher<const internal::StringView&> m4 =
1861 MatchesRegex(internal::StringView(""));
1862 EXPECT_TRUE(m4.Matches(internal::StringView("")));
1863 EXPECT_TRUE(m4.Matches(internal::StringView()));
1875 Matcher<const internal::StringView> m3 = MatchesRegex(new RE("0.*"));
1894 const Matcher<const internal::StringView&> m3 = ContainsRegex(new RE("a.*z"));
1895 EXPECT_TRUE(m3.Matches(internal::StringView("azbz")));
1896 EXPECT_TRUE(m3.Matches(internal::StringView("az1")));
1897 EXPECT_FALSE(m3.Matches(internal::StringView("1a")));
1898 EXPECT_FALSE(m3.Matches(internal::StringView()));
1899 const Matcher<const internal::StringView&> m4 =
1900 ContainsRegex(internal::StringView(""));
1901 EXPECT_TRUE(m4.Matches(internal::StringView("")));
1902 EXPECT_TRUE(m4.Matches(internal::StringView()));
1914 Matcher<const internal::StringView> m3 = ContainsRegex(new RE("0.*"));
1945 Matcher<::std::wstring> m = StrEq(L"Hi-\'\"?\\\a\b\f\n\r\t\v");
1946 EXPECT_EQ("is equal to L\"Hi-\'\\\"?\\\\\\a\\b\\f\\n\\r\\t\\v\"",
2036 // Tests that HasSubstr() works for matching wstring-typed values.
2047 // Tests that HasSubstr() works for matching C-wide-string-typed values.
2256 "when dynamic_cast to " + internal::GetTypeName<Derived*>() + ", ";
2309 int divider() const { return divider_; }
2363 EXPECT_EQ(42, impl.divider());
2366 EXPECT_EQ(0, m.mutable_impl().divider());
2373 EXPECT_EQ(42, impl.divider());