Unit Tests
- Added extra format test for the Julian date format.
This commit is contained in:
@@ -35,7 +35,7 @@ Context context;
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int main (int argc, char** argv)
|
int main (int argc, char** argv)
|
||||||
{
|
{
|
||||||
UnitTest t (222);
|
UnitTest t (223);
|
||||||
|
|
||||||
// void wrapText (std::vector <std::string>& lines, const std::string& text, const int width)
|
// void wrapText (std::vector <std::string>& lines, const std::string& text, const int width)
|
||||||
std::string text = "This is a test of the line wrapping code.";
|
std::string text = "This is a test of the line wrapping code.";
|
||||||
@@ -401,14 +401,15 @@ int main (int argc, char** argv)
|
|||||||
t.is (formatHex (123), "7b", "formatHex (123) -> 7b");
|
t.is (formatHex (123), "7b", "formatHex (123) -> 7b");
|
||||||
|
|
||||||
// std::string format (float, int, int);
|
// std::string format (float, int, int);
|
||||||
t.is (format (1.23456789, 8, 1), " 1", "format (1.23456789, 8, 1) -> _______1");
|
t.is (format (1.23456789, 8, 1), " 1", "format (1.23456789, 8, 1) -> _______1");
|
||||||
t.is (format (1.23456789, 8, 2), " 1.2", "format (1.23456789, 8, 2) -> _____1.2");
|
t.is (format (1.23456789, 8, 2), " 1.2", "format (1.23456789, 8, 2) -> _____1.2");
|
||||||
t.is (format (1.23456789, 8, 3), " 1.23", "format (1.23456789, 8, 3) -> ____1.23");
|
t.is (format (1.23456789, 8, 3), " 1.23", "format (1.23456789, 8, 3) -> ____1.23");
|
||||||
t.is (format (1.23456789, 8, 4), " 1.235", "format (1.23456789, 8, 4) -> ___1.235");
|
t.is (format (1.23456789, 8, 4), " 1.235", "format (1.23456789, 8, 4) -> ___1.235");
|
||||||
t.is (format (1.23456789, 8, 5), " 1.2346", "format (1.23456789, 8, 5) -> __1.2346");
|
t.is (format (1.23456789, 8, 5), " 1.2346", "format (1.23456789, 8, 5) -> __1.2346");
|
||||||
t.is (format (1.23456789, 8, 6), " 1.23457", "format (1.23456789, 8, 6) -> 1.23457");
|
t.is (format (1.23456789, 8, 6), " 1.23457", "format (1.23456789, 8, 6) -> 1.23457");
|
||||||
t.is (format (1.23456789, 8, 7), "1.234568", "format (1.23456789, 8, 7) -> 1.234568");
|
t.is (format (1.23456789, 8, 7), "1.234568", "format (1.23456789, 8, 7) -> 1.234568");
|
||||||
t.is (format (1.23456789, 8, 8), "1.2345679", "format (1.23456789, 8, 8) -> 1.2345679");
|
t.is (format (1.23456789, 8, 8), "1.2345679", "format (1.23456789, 8, 8) -> 1.2345679");
|
||||||
|
t.is (format (2444238.56789, 12, 11), "2444238.5679", "format (2444238.56789, 12, 11) -> 2444238.5679");
|
||||||
|
|
||||||
// std::string format (double, int, int);
|
// std::string format (double, int, int);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user