2
0
mirror of https://github.com/boostorg/format.git synced 2026-01-26 06:32:14 +00:00

trac-7379: added a couple tests and beefed up existing ones

This commit is contained in:
James E. King, III
2017-10-12 08:38:13 -07:00
parent bc53dbbaa2
commit e019e8dcc6
2 changed files with 11 additions and 1 deletions

View File

@@ -29,8 +29,16 @@ int test_main(int, char* [])
BOOST_ERROR("Basic w-parsing Failed");
if(str( wformat(L"%%##%#x ##%%1 %s00") % 20 % L"Escaped OK" ) != L"%##0x14 ##%1 Escaped OK00")
BOOST_ERROR("Basic wp-parsing Failed") ;
#endif // wformat tests
// testcase for https://svn.boost.org/trac10/ticket/7379 (for valgrind)
wformat wfmt(L"%1$.1f");
std::wstring ws = str(wfmt % 123.45f);
BOOST_CHECK_EQUAL(ws.compare(L"123.4"), 0);
wformat wfmt2(L"%1$.0f %%");
std::wstring ws2 = (wfmt2 % 123.45f).str();
BOOST_CHECK_EQUAL(ws2.compare(L"123 %"), 0);
#endif // wformat tests
return 0;
}