| 1791 | // or ::std::wstring. |
| 1792 | template <typename StringType> |
| 1793 | AssertionResult 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 |
no test coverage detected