tests for bool in ToString/StringTo

This commit is contained in:
froejdh_e
2025-05-30 15:58:26 +02:00
parent e77fd8d85d
commit e14d307a42
3 changed files with 20 additions and 0 deletions

View File

@ -16,6 +16,17 @@ namespace sls {
using namespace sls::time;
TEST_CASE("Convert bool to string", "[support]") {
REQUIRE(ToString(true) == "1");
REQUIRE(ToString(false) == "0");
}
TEST_CASE("Convert string to bool", "[support]") {
REQUIRE(StringTo<bool>("1") == true);
REQUIRE(StringTo<bool>("0") == false);
}
TEST_CASE("Integer conversions", "[support]") {
REQUIRE(ToString(0) == "0");
REQUIRE(ToString(1) == "1");