You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
745 B

  1. #include "UnitTestPCH.h"
  2. #include "utNoBoostTest.h"
  3. CPPUNIT_TEST_SUITE_REGISTRATION (NoBoostTest);
  4. // ------------------------------------------------------------------------------------------------
  5. void NoBoostTest :: testFormat()
  6. {
  7. CPPUNIT_ASSERT( noboost::str( noboost::format("Ahoi!") ) == "Ahoi!" );
  8. CPPUNIT_ASSERT( noboost::str( noboost::format("Ahoi! %%") ) == "Ahoi! %" );
  9. CPPUNIT_ASSERT( noboost::str( noboost::format("Ahoi! %s") ) == "Ahoi! " );
  10. CPPUNIT_ASSERT( noboost::str( noboost::format("Ahoi! %s") % "!!" ) == "Ahoi! !!" );
  11. CPPUNIT_ASSERT( noboost::str( noboost::format("Ahoi! %s") % "!!" % "!!" ) == "Ahoi! !!" );
  12. CPPUNIT_ASSERT( noboost::str( noboost::format("%s%s%s") % "a" % std::string("b") % "c" ) == "abc" );
  13. }