| 2558 | // or ::std::wstring. |
| 2559 | template <typename StringType> |
| 2560 | AssertionResult IsSubstringImpl( |
| 2561 | bool expected_to_be_substring, |
| 2562 | const char* needle_expr, const char* haystack_expr, |
| 2563 | const StringType& needle, const StringType& haystack) { |
| 2564 | if (IsSubstringPred(needle, haystack) == expected_to_be_substring) |
| 2565 | return AssertionSuccess(); |
| 2566 | |
| 2567 | const bool is_wide_string = sizeof(needle[0]) > 1; |
| 2568 | const char* const begin_string_quote = is_wide_string ? "L\"" : "\""; |
| 2569 | return AssertionFailure() |
| 2570 | << "Value of: " << needle_expr << "\n" |
| 2571 | << " Actual: " << begin_string_quote << needle << "\"\n" |
| 2572 | << "Expected: " << (expected_to_be_substring ? "" : "not ") |
| 2573 | << "a substring of " << haystack_expr << "\n" |
| 2574 | << "Which is: " << begin_string_quote << haystack << "\""; |
| 2575 | } |
| 2576 | |
| 2577 | } // namespace |
| 2578 |
no test coverage detected