diff options
| author | mat <github@matdoes.dev> | 2022-09-07 22:12:16 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-09-07 22:12:16 -0500 |
| commit | 98000f800f31c85c7bbf121b116047137b503c49 (patch) | |
| tree | 720e21b59e1b10eed6e66b6ace06714407d68f54 /azalea-protocol/src/packets | |
| parent | ec316e02cd7d86829614ec1c0b7e3edadad103c5 (diff) | |
| download | azalea-drasl-98000f800f31c85c7bbf121b116047137b503c49.tar.xz | |
why am i getting a varint error
Diffstat (limited to 'azalea-protocol/src/packets')
| -rw-r--r-- | azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs index 7192f88a..5d3bdd23 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs @@ -14,7 +14,7 @@ pub struct ClientboundPlayerChatPacket { pub chat_type: ChatTypeBound, } -#[derive(Copy, Clone, Debug, McBuf)] +#[derive(Copy, Clone, Debug, McBuf, PartialEq, Eq)] pub enum ChatType { Chat = 0, SayCommand = 1, @@ -115,3 +115,15 @@ impl McBufWritable for FilterMask { Ok(()) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_chat_type() { + let chat_type_enum = ChatType::read_from(&mut &[0x06][..]).unwrap(); + assert_eq!(chat_type_enum, ChatType::EmoteCommand); + assert!(ChatType::read_from(&mut &[0x07][..]).is_err()); + } +} |
