aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/c_set_entity_data.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-protocol/src/packets/game/c_set_entity_data.rs')
-rwxr-xr-xazalea-protocol/src/packets/game/c_set_entity_data.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/azalea-protocol/src/packets/game/c_set_entity_data.rs b/azalea-protocol/src/packets/game/c_set_entity_data.rs
index da6536fe..769c2edf 100755
--- a/azalea-protocol/src/packets/game/c_set_entity_data.rs
+++ b/azalea-protocol/src/packets/game/c_set_entity_data.rs
@@ -8,3 +8,26 @@ pub struct ClientboundSetEntityData {
pub id: u32,
pub packed_items: EntityMetadataItems,
}
+
+#[cfg(test)]
+mod tests {
+ use std::io::Cursor;
+
+ use azalea_buf::AzaleaRead;
+
+ use super::*;
+
+ #[test]
+ fn test_read_write_container_set_content() {
+ let contents = [161, 226, 1, 10, 18, 1, 20, 38, 124, 175, 198, 255];
+ let mut buf = Cursor::new(contents.as_slice());
+ let packet = ClientboundSetEntityData::azalea_read(&mut buf).unwrap();
+ println!("{:?}", packet);
+
+ assert_eq!(buf.position(), contents.len() as u64);
+
+ let mut buf = Vec::new();
+ packet.write(&mut buf).unwrap();
+ assert_eq!(buf, contents);
+ }
+}