[#BloombergLP-bdlt-FormatTestUtil-testFormatArg]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/FormatTestUtil.adoc[FormatTestUtil]::testFormatArg
:relfileprefix: ../../../
:mrdocs:

Compare `bsl&colon;&colon;format` output of `value` and `arg` to an expected string&period;

== Synopsis

Declared in `&lt;bdlt&lowbar;formattestutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;VALUE&lowbar;TYPE,
    class t&lowbar;ARG&lowbar;TYPE&gt;
static
bool
testFormatArg(
    xref:bsl/string.adoc[bsl::string]* message,
    std::string&lowbar;view const& exp,
    std::string&lowbar;view const& format,
    t&lowbar;VALUE&lowbar;TYPE const& value,
    t&lowbar;ARG&lowbar;TYPE const& arg);
----

== Description

Compare the specified `exp` to the string result of calling `bsl&colon;&colon;format` with the specified `format`, `value`, and `arg`, and return `true` if they match and `false` otherwise&period; If they do not match, load into the specified `message` a value describing the inputs and result of the failed test&period; Perform these tests for both `char`&hyphen;based and `wchar&lowbar;t`&hyphen;based strings&period;

== Return Value

`true` if the formatted result matches `exp`, and `false` otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *message*
| loaded with a failure description when the comparison fails
| *exp*
| expected formatted result
| *format*
| format string passed to `bsl&colon;&colon;format`
| *value*
| value to format
| *arg*
| additional argument passed to `bsl&colon;&colon;format`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
