| 2742 | // or ::std::wstring. |
| 2743 | template <typename StringType> |
| 2744 | AssertionResult IsSubstringImpl( |
| 2745 | bool expected_to_be_substring, |
| 2746 | const char* needle_expr, const char* haystack_expr, |
| 2747 | const StringType& needle, const StringType& haystack) { |
| 2748 | if (IsSubstringPred(needle, haystack) == expected_to_be_substring) |
| 2749 | return AssertionSuccess(); |
| 2750 | |
| 2751 | const bool is_wide_string = sizeof(needle[0]) > 1; |
| 2752 | const char* const begin_string_quote = is_wide_string ? "L\"" : "\""; |
| 2753 | return AssertionFailure() |
| 2754 | << "Value of: " << needle_expr << "\n" |
| 2755 | << " Actual: " << begin_string_quote << needle << "\"\n" |
| 2756 | << "Expected: " << (expected_to_be_substring ? "" : "not ") |
| 2757 | << "a substring of " << haystack_expr << "\n" |
| 2758 | << "Which is: " << begin_string_quote << haystack << "\""; |
| 2759 | } |
| 2760 | |
| 2761 | } // namespace |
| 2762 |
no test coverage detected