mirror of
https://github.com/textmate/textmate.git
synced 2026-01-23 13:47:54 -05:00
19 lines
719 B
C++
19 lines
719 B
C++
#include <text/format.h>
|
|
|
|
class format_tests : public CxxTest::TestSuite
|
|
{
|
|
public:
|
|
void test_format_number ()
|
|
{
|
|
TS_ASSERT_EQUALS(text::format_size(1), "1 byte");
|
|
TS_ASSERT_EQUALS(text::format_size(2), "2 bytes");
|
|
TS_ASSERT_EQUALS(text::format_size(600), "600 bytes");
|
|
TS_ASSERT_EQUALS(text::format_size(1024), "1.0 KiB");
|
|
TS_ASSERT_EQUALS(text::format_size(5*1024), "5.0 KiB");
|
|
TS_ASSERT_EQUALS(text::format_size(5*1024+512), "5.5 KiB");
|
|
TS_ASSERT_EQUALS(text::format_size(1024*1024), "1.0 MiB");
|
|
TS_ASSERT_EQUALS(text::format_size(5*1024*1024), "5.0 MiB");
|
|
TS_ASSERT_EQUALS(text::format_size(1024*1024*1024), "1.0 GiB");
|
|
}
|
|
};
|