| 3072 | // or ::std::wstring. |
| 3073 | template <typename StringType> |
| 3074 | AssertionResult IsSubstringImpl( |
| 3075 | bool expected_to_be_substring, |
| 3076 | const char* needle_expr, const char* haystack_expr, |
| 3077 | const StringType& needle, const StringType& haystack) { |
| 3078 | if (IsSubstringPred(needle, haystack) == expected_to_be_substring) |
| 3079 | return AssertionSuccess(); |
| 3080 | |
| 3081 | const bool is_wide_string = sizeof(needle[0]) > 1; |
| 3082 | const char* const begin_string_quote = is_wide_string ? "L\"" : "\""; |
| 3083 | return AssertionFailure() |
| 3084 | << "Value of: " << needle_expr << "\n" |
| 3085 | << " Actual: " << begin_string_quote << needle << "\"\n" |
| 3086 | << "Expected: " << (expected_to_be_substring ? "" : "not ") |
| 3087 | << "a substring of " << haystack_expr << "\n" |
| 3088 | << "Which is: " << begin_string_quote << haystack << "\""; |
| 3089 | } |
| 3090 | |
| 3091 | } // namespace |
| 3092 |
no test coverage detected