aria2/test/FmtTest.cc
Tatsuhiro Tsujikawa 694fb307aa 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced StringFormat with fmt
2010-11-20 09:36:14 +00:00

29 lines
526 B
C++

#include "fmt.h"
#include <cppunit/extensions/HelperMacros.h>
namespace aria2 {
class FmtTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(FmtTest);
CPPUNIT_TEST(testFmt);
CPPUNIT_TEST_SUITE_END();
public:
void testFmt();
};
CPPUNIT_TEST_SUITE_REGISTRATION(FmtTest);
void FmtTest::testFmt()
{
int major = 1;
int minor = 0;
int release = 7;
CPPUNIT_ASSERT_EQUAL(std::string("aria2-1.0.7-beta"),
fmt("aria2-%d.%d.%d-%s", major, minor, release, "beta"));
}
} // namespace aria2