chore: add string::fromHex

This commit is contained in:
sithlord48
2025-01-25 08:39:13 -05:00
committed by Nick Bolton
parent 3125eba014
commit f255d77eee
3 changed files with 41 additions and 0 deletions

View File

@ -86,6 +86,13 @@ TEST(StringTests, fromHexChar_plaintext_hexString)
EXPECT_EQ(15, string::fromHexChar('F'));
}
TEST(StringTests, fromHex_plaintext_hexString)
{
EXPECT_EQ(255, string::fromHex("FF")[0]);
EXPECT_EQ(255, string::fromHex(":FF:EE")[0]);
EXPECT_EQ(238, string::fromHex(":FF:EE")[1]);
}
TEST(StringTests, uppercase_lowercaseInput_uppercaseOutput)
{
std::string subject = "12foo3BaR";