Skip to content

Commit

Permalink
Put quotes around strings in Catch::StringMaker<wxString>
Browse files Browse the repository at this point in the history
This makes the output in case of test failure more readable, especially
if one of the strings is empty.
  • Loading branch information
vadz committed Mar 28, 2023
1 parent a098fb1 commit e4e3e7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/wx/catch_cppunit.h
Expand Up @@ -89,14 +89,16 @@ namespace Catch
static std::string convert(const wxString& wxs)
{
std::string s;
s.reserve(wxs.length());
s.reserve(wxs.length() + 2);
s += '"';
for ( auto c : wxs )
{
if ( c >= 128 || !iswprint(c) )
s += wxString::Format(wxASCII_STR("\\u%04X"), c).ToAscii();
else
s += c;
}
s += '"';

return s;
}
Expand Down

0 comments on commit e4e3e7e

Please sign in to comment.