tests/utils: Add tests for base64Encode
Test vectors according to RFC4648
This commit is contained in:
parent
bbc4afcf1b
commit
46a4b615c8
|
@ -144,3 +144,13 @@ TEST_CASE("join") {
|
|||
REQUIRE(join({"a", "b"}, ",") == "a,b");
|
||||
REQUIRE(join({"a", "b"}, "") == "ab");
|
||||
}
|
||||
|
||||
TEST_CASE("base64Encode") {
|
||||
REQUIRE(base64Encode("") == "");
|
||||
REQUIRE(base64Encode("f") == "Zg==");
|
||||
REQUIRE(base64Encode("fo") == "Zm8=");
|
||||
REQUIRE(base64Encode("foo") == "Zm9v");
|
||||
REQUIRE(base64Encode("foob") == "Zm9vYg==");
|
||||
REQUIRE(base64Encode("fooba") == "Zm9vYmE=");
|
||||
REQUIRE(base64Encode("foobar") == "Zm9vYmFy");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue