mirror of
https://github.com/aria2/aria2.git
synced 2024-11-30 05:24:34 +08:00
29 lines
528 B
C++
29 lines
528 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
|