mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
improves packet_id test
This commit is contained in:
parent
dfe9ba6a0b
commit
5fb7482565
1 changed files with 10 additions and 2 deletions
|
@ -33,9 +33,17 @@ fn test_packet_id() {
|
|||
fragment: None
|
||||
};
|
||||
|
||||
assert_eq!(packet.packet_id(), expected_id);
|
||||
let packet_id = packet.packet_id();
|
||||
|
||||
assert_eq!(packet_id, expected_id);
|
||||
|
||||
let expected_rendered = b"|| psyc://ve.symlynx.com/~alice| psyc://ve.symlynx.com/~bob| 42|";
|
||||
|
||||
assert_eq!(packet.packet_id().render(), expected_rendered.to_vec());
|
||||
let rendered_id = packet_id.render();
|
||||
|
||||
assert_eq!(rendered_id, expected_rendered.to_vec());
|
||||
|
||||
let parsed_id = PacketId::from_bytes(&rendered_id);
|
||||
|
||||
assert_eq!(parsed_id.unwrap(), packet_id);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue