MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / IsSubstringImpl

Function IsSubstringImpl

source/test/gtest/src/gtest.cc:1793–1809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1791// or ::std::wstring.
1792template <typename StringType>
1793AssertionResult IsSubstringImpl(bool expected_to_be_substring,
1794 const char* needle_expr,
1795 const char* haystack_expr,
1796 const StringType& needle,
1797 const StringType& haystack) {
1798 if (IsSubstringPred(needle, haystack) == expected_to_be_substring)
1799 return AssertionSuccess();
1800
1801 const bool is_wide_string = sizeof(needle[0]) > 1;
1802 const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";
1803 return AssertionFailure()
1804 << "Value of: " << needle_expr << "\n"
1805 << " Actual: " << begin_string_quote << needle << "\"\n"
1806 << "Expected: " << (expected_to_be_substring ? "" : "not ")
1807 << "a substring of " << haystack_expr << "\n"
1808 << "Which is: " << begin_string_quote << haystack << "\"";
1809}
1810
1811} // namespace
1812

Callers 2

IsSubstringFunction · 0.85
IsNotSubstringFunction · 0.85

Calls 3

IsSubstringPredFunction · 0.85
AssertionSuccessFunction · 0.85
AssertionFailureFunction · 0.85

Tested by

no test coverage detected