This commit is contained in:
2026-07-29 03:05:26 +03:00
parent 4a79f260c5
commit f1fbd5ac3f
+2 -4
View File
@@ -25,10 +25,8 @@ TEST(unit_test_hashing, base64_encode)
TEST(unit_test_hashing, base64_decode)
{
constexpr auto decoded = omath::hashing::base64_decode("Zm9v");
static_assert(decoded.has_value());
static_assert(decoded.value() == "foo");
static_assert(omath::hashing::base64_decode("Zm9v").has_value());
static_assert(omath::hashing::base64_decode("Zm9v").value() == "foo");
EXPECT_EQ(omath::hashing::base64_decode("Zm9vYmFy").value(), "foobar");
EXPECT_EQ(omath::hashing::base64_decode("Zm9v=").error(), omath::hashing::Base64Error::INVALID_LENGTH);
EXPECT_EQ(omath::hashing::base64_decode("Zm?v").error(), omath::hashing::Base64Error::INVALID_CHARACTER);