fix stuff, add class annotation

This commit is contained in:
Jean-Marie Mineau 2023-11-28 19:06:28 +01:00
parent b8b4e28f2d
commit cf55766653
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
10 changed files with 164 additions and 117 deletions

View file

@ -241,6 +241,7 @@ mod test {
const ANNOTATION_ITEM: &[u8] = &[
0x02, 0xbe, 0x37, 0x01, 0xa8, 0x9f, 0x03, 0x1d, 0xf6, 0x33, 0x01, 0xd3, 0xe8, 0x02, 0x3f,
];
const ANNOTATION_ITEM_2: &[u8] = &[0x02, 0xbf, 0x37, 0x01, 0xa8, 0x9f, 0x03, 0x38, 0x38, 0x02];
#[test]
fn deserialize_annotation_item() {
@ -252,6 +253,14 @@ mod test {
.unwrap(),
}
);
assert_eq!(
AnnotationItem::deserialize_from_slice(ANNOTATION_ITEM_2).unwrap(),
AnnotationItem {
visibility: AnnotationVisibility::System,
annotation: EncodedAnnotation::deserialize_from_slice(&ANNOTATION_ITEM_2[1..])
.unwrap(),
}
);
}
#[test]
@ -267,5 +276,16 @@ mod test {
.unwrap()
.as_slice()
);
assert_eq!(
ANNOTATION_ITEM_2,
AnnotationItem {
visibility: AnnotationVisibility::System,
annotation: EncodedAnnotation::deserialize_from_slice(&ANNOTATION_ITEM_2[1..])
.unwrap(),
}
.serialize_to_vec()
.unwrap()
.as_slice()
);
}
}