Skip to content

Commit

Permalink
Test serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
wussler committed Dec 6, 2022
1 parent dc1905b commit cc09ac3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions openpgp/keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,23 @@ func TestNotationPacket(t *testing.T) {
t.Fatal(err)
}

assertNotationPackets(t, keys)

serializedEntity := bytes.NewBuffer(nil)
err = keys[0].Serialize(serializedEntity)
if err != nil {
t.Fatal(err)
}

keys, err = ReadKeyRing(serializedEntity)
if err != nil {
t.Fatal(err)
}

assertNotationPackets(t, keys)
}

func assertNotationPackets(t *testing.T, keys EntityList) {
if len(keys) != 1 {
t.Errorf("Failed to accept key, %d", len(keys))
}
Expand Down

0 comments on commit cc09ac3

Please sign in to comment.