| 1752 | // or ::std::wstring. |
| 1753 | template <typename StringType> |
| 1754 | AssertionResult IsSubstringImpl( |
| 1755 | bool expected_to_be_substring, |
| 1756 | const char* needle_expr, const char* haystack_expr, |
| 1757 | const StringType& needle, const StringType& haystack) { |
| 1758 | if (IsSubstringPred(needle, haystack) == expected_to_be_substring) |
| 1759 | return AssertionSuccess(); |
| 1760 | |
| 1761 | const bool is_wide_string = sizeof(needle[0]) > 1; |
| 1762 | const char* const begin_string_quote = is_wide_string ? "L\"" : "\""; |
| 1763 | return AssertionFailure() |
| 1764 | << "Value of: " << needle_expr << "\n" |
| 1765 | << " Actual: " << begin_string_quote << needle << "\"\n" |
| 1766 | << "Expected: " << (expected_to_be_substring ? "" : "not ") |
| 1767 | << "a substring of " << haystack_expr << "\n" |
| 1768 | << "Which is: " << begin_string_quote << haystack << "\""; |
| 1769 | } |
| 1770 | |
| 1771 | } // namespace |
| 1772 |
no test coverage detected