| 3053 | // or ::std::wstring. |
| 3054 | template <typename StringType> |
| 3055 | AssertionResult IsSubstringImpl( |
| 3056 | bool expected_to_be_substring, |
| 3057 | const char* needle_expr, const char* haystack_expr, |
| 3058 | const StringType& needle, const StringType& haystack) { |
| 3059 | if (IsSubstringPred(needle, haystack) == expected_to_be_substring) |
| 3060 | return AssertionSuccess(); |
| 3061 | |
| 3062 | const bool is_wide_string = sizeof(needle[0]) > 1; |
| 3063 | const char* const begin_string_quote = is_wide_string ? "L\"" : "\""; |
| 3064 | return AssertionFailure() |
| 3065 | << "Value of: " << needle_expr << "\n" |
| 3066 | << " Actual: " << begin_string_quote << needle << "\"\n" |
| 3067 | << "Expected: " << (expected_to_be_substring ? "" : "not ") |
| 3068 | << "a substring of " << haystack_expr << "\n" |
| 3069 | << "Which is: " << begin_string_quote << haystack << "\""; |
| 3070 | } |
| 3071 | |
| 3072 | } // namespace |
| 3073 |
no test coverage detected