diff --git a/tests/unittest.cpp b/tests/unittest.cpp index 41be5f19f..7c033c657 100644 --- a/tests/unittest.cpp +++ b/tests/unittest.cpp @@ -3113,3 +3113,27 @@ TEST_CASE("trim") CHECK(utility::trim(" a b ") == "a b"); CHECK(utility::trim(" ") == ""); } + +TEST_CASE("string_equals") +{ + CHECK(utility::string_equals("a", "aa") == false); + CHECK(utility::string_equals("a", "b") == false); + CHECK(utility::string_equals("", "") == true); + CHECK(utility::string_equals("abc", "abc") == true); + CHECK(utility::string_equals("ABC", "abc") == true); + + CHECK(utility::string_equals("a", "aa", true) == false); + CHECK(utility::string_equals("a", "b", true) == false); + CHECK(utility::string_equals("", "", true) == true); + CHECK(utility::string_equals("abc", "abc", true) == true); + CHECK(utility::string_equals("ABC", "abc", true) == false); +} + +TEST_CASE("lexical_cast") +{ + CHECK(utility::lexical_cast(4) == 4); + CHECK(utility::lexical_cast(4) == 4.0); + CHECK(utility::lexical_cast("5") == 5); + CHECK(utility::lexical_cast(4) == "4"); + CHECK(utility::lexical_cast("10", 2) == 10.0f); +}