BloombergLP::bslfmt::FormatterTestUtil<char>::testEvaluateFormat

Compare formatting of value and arg against expectedResult.

Synopsis

Declared in <bslfmt_formattertestutil.h>

template<
    class t_TYPE,
    class t_ARG>
static
bool
testEvaluateFormat(
    bsl::string* message,
    bsl::basic_string_view<char> expectedResult,
    bool alsoTestOracle,
    std::format_string<t_TYPE, t_ARG> fmt,
    t_TYPE&& value,
    t_ARG&& arg);

Description

Compare the specified expectedResult with the result of formatting the specified value and arg with the specified fmt obtained using a bslfmt::formatter specialization for the (template parameter) t_TYPE. If the specified alsoTestOracle is true, also compare the expectedResult with the result of formatting obtained using standard library implementation. Return true if these strings are equal, otherwise store a description of the error in the specified output message and return false. Note that fmt is required to be a compile time constant expression.

Return Value

true if formatting matches expectedResult, else false.

Parameters

NameDescription
messageOutput parameter for an error description on failure.
expectedResultExpected formatted output string.
alsoTestOracleIf true, also compare against the standard library formatter.
fmtCompile-time format string (one additional argument).
valuePrimary value to format.
argAdditional format argument.