MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / IsSubstringImpl

Function IsSubstringImpl

tests/gtest/gtest-all.cc:3074–3089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3072// or ::std::wstring.
3073template <typename StringType>
3074AssertionResult 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

Callers 2

IsSubstringFunction · 0.85
IsNotSubstringFunction · 0.85

Calls 3

IsSubstringPredFunction · 0.85
AssertionSuccessFunction · 0.85
AssertionFailureFunction · 0.85

Tested by

no test coverage detected