_not_ round-trip tests for fetchers::PublicKey default type (#10637)

Another continuation of #10602
This commit is contained in:
HaeNoe 2024-05-06 15:50:26 +02:00 committed by GitHub
parent ee2fa87a7e
commit feb1d10f60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,3 @@
{
"key": "ABCDE"
}

View File

@ -42,4 +42,13 @@ TEST_JSON(PublicKeyTest, simple, (fetchers::PublicKey { .type = "ssh-rsa", .key
TEST_JSON(PublicKeyTest, defaultType, fetchers::PublicKey { .key = "ABCDE" })
#undef TEST_JSON
TEST_F(PublicKeyTest, PublicKey_noRoundTrip_from_json) {
readTest("noRoundTrip.json", [&](const auto & encoded_) {
fetchers::PublicKey expected = { .type = "ssh-ed25519", .key = "ABCDE" };
fetchers::PublicKey got = nlohmann::json::parse(encoded_);
ASSERT_EQ(got, nlohmann::json(expected));
});
}
}