Skip to content

Commit 2c37ade

Browse files
committed
add a test for 2b2t queue chat message
1 parent 63fef9d commit 2c37ade

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

azalea-protocol/src/packets/game/c_system_chat.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,18 @@ mod tests {
4242
"Displaying particle minecraft:dust".to_string()
4343
);
4444
}
45+
46+
#[test]
47+
fn test_2b2t_queue_message() {
48+
#[rustfmt::skip]
49+
let bytes = [
50+
10, 9, 0, 5, 101, 120, 116, 114, 97, 10, 0, 0, 0, 1, 8, 0, 4, 116, 101, 120, 116, 0, 95, 80, 111, 115, 105, 116, 105, 111, 110, 32, 105, 110, 32, 113, 117, 101, 117, 101, 58, 32, 51, 50, 56, 10, 89, 111, 117, 32, 99, 97, 110, 32, 112, 117, 114, 99, 104, 97, 115, 101, 32, 112, 114, 105, 111, 114, 105, 116, 121, 32, 113, 117, 101, 117, 101, 32, 115, 116, 97, 116, 117, 115, 32, 116, 111, 32, 106, 111, 105, 110, 32, 116, 104, 101, 32, 115, 101, 114, 118, 101, 114, 32, 102, 97, 115, 116, 101, 114, 44, 32, 118, 105, 115, 105, 116, 32, 8, 0, 5, 99, 111, 108, 111, 114, 0, 4, 103, 111, 108, 100, 9, 0, 5, 101, 120, 116, 114, 97, 10, 0, 0, 0, 1, 10, 0, 10, 99, 108, 105, 99, 107, 69, 118, 101, 110, 116, 8, 0, 6, 97, 99, 116, 105, 111, 110, 0, 8, 111, 112, 101, 110, 95, 117, 114, 108, 8, 0, 5, 118, 97, 108, 117, 101, 0, 22, 104, 116, 116, 112, 115, 58, 47, 47, 115, 104, 111, 112, 46, 50, 98, 50, 116, 46, 111, 114, 103, 47, 0, 1, 0, 4, 98, 111, 108, 100, 1, 8, 0, 4, 116, 101, 120, 116, 0, 13, 115, 104, 111, 112, 46, 50, 98, 50, 116, 46, 111, 114, 103, 0, 0, 8, 0, 4, 116, 101, 120, 116, 0, 20, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0
51+
];
52+
let packet = ClientboundSystemChat::azalea_read(&mut Cursor::new(&bytes)).unwrap();
53+
54+
assert_eq!(
55+
packet.content.to_string().trim(),
56+
"Position in queue: 328\nYou can purchase priority queue status to join the server faster, visit shop.2b2t.org".to_string()
57+
);
58+
}
4559
}

0 commit comments

Comments
 (0)