diff --git a/test/format_test3.cpp b/test/format_test3.cpp index 231a91b..1633627 100644 --- a/test/format_test3.cpp +++ b/test/format_test3.cpp @@ -123,10 +123,12 @@ int test_main(int, char* []) // http://lists.boost.org/boost-users/2005/11/15454.php std::string l_param; std::string l_str = (boost::format("here is an empty string: %1%") % l_param).str(); + BOOST_CHECK_EQUAL(std::string("here is an empty string: "), l_str); // testcase for SourceForge bug #1506914 std::string arg; // empty string s = str(format("%=8s") % arg); + BOOST_CHECK_EQUAL(std::string(" "), s); return 0; } diff --git a/test/format_test_wstring.cpp b/test/format_test_wstring.cpp index c30f740..4f9a871 100644 --- a/test/format_test_wstring.cpp +++ b/test/format_test_wstring.cpp @@ -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; }