tests for bool in ToString/StringTo (#1230)
All checks were successful
Build on RHEL9 / build (push) Successful in 3m18s
Build on RHEL8 / build (push) Successful in 4m57s

- Added tests for ToString/StringTo<bool>
- Added overload for ToString of bool (previously went through int)
This commit is contained in:
Erik Fröjdh
2025-06-03 08:36:29 +02:00
committed by GitHub
parent c92830f854
commit f84454fbc1
4 changed files with 20 additions and 1 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");