(a) yes, i know std::format() exists
(b) and yet, my power grows...
(i wrote a format() function that checks the format string at compile time)
(i'm gonna build all sorts of infrastructure on top of this)
(i'm excited)
CRUCIBLE_TEST_SCENARIO(format_bool)
{
{
auto const result { format("{}", true) };
CRUCIBLE_CORE_ASSERT_EQ(result.size(), 4);
CRUCIBLE_CORE_ASSERT_EQ(result, "true");
}
{
auto const result { format("{}", false) };
CRUCIBLE_CORE_ASSERT_EQ(result.size(), 5);
CRUCIBLE_CORE_ASSERT_EQ(result, "false");
}
}
CRUCIBLE_TEST_SCENARIO(format_cstring)
{
{
auto const result { format("{}", "") };
CRUCIBLE_CORE_ASSERT_EQ(result, "");
}
{
auto const result { format("{}", "hello") };
CRUCIBLE_CORE_ASSERT_EQ(result, "hello");
}
}

eggbug enjoyer