diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index 4f9ed6325..d8a14ed5e 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -33,6 +33,7 @@ private: void run() { TEST_CASE(calculate); + TEST_CASE(convert); } void calculate() @@ -44,6 +45,13 @@ private: ASSERT_EQUALS(std::string("7"), MathLib::divide("21.", "3")); ASSERT_EQUALS(std::string("1"), MathLib::divide("3", "2")); } + + void convert() + { + ASSERT_EQUALS(10, MathLib::toLongNumber("0xa")); + ASSERT_EQUALS(8, MathLib::toLongNumber("010")); + ASSERT_EQUALS(10, MathLib::toLongNumber("10")); + } }; REGISTER_TEST(TestMathLib)