BloombergLP::bslim::TestUtil::compareText

Return whether two text strings have the same value.

Synopsis

Declared in <bslim_testutil.h>

static
bool
compareText(
    bslstl::StringRef lhs,
    bslstl::StringRef rhs,
    std::ostream& errorStream = bsl::cout);

Description

Return true if the specified lhs has the same value as the specified rhs, and false otherwise. Optionally specify an errorStream on which, if lhs and rhs are not the same, a description of how the two strings differ will be written. If errorStream is not supplied, stdout is used.

Return Value

true if lhs and rhs have the same value, and false otherwise

Parameters

NameDescription
lhsleft-hand string to compare
rhsright-hand string to compare
errorStreamstream for difference description; defaults to bsl::cout