mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 08:12:29 +00:00
_not_ round-trip tests for fetchers::PublicKey
default type
(#10637)
Another continuation of #10602
This commit is contained in:
parent
ee2fa87a7e
commit
feb1d10f60
3
tests/unit/libfetchers/data/public-key/noRoundTrip.json
Normal file
3
tests/unit/libfetchers/data/public-key/noRoundTrip.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"key": "ABCDE"
|
||||
}
|
@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user