1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00
azalea/azalea-client/tests/client_disconnect.rs

20 lines
514 B
Rust

use azalea_client::test_utils::prelude::*;
use azalea_protocol::packets::ConnectionProtocol;
use azalea_world::InstanceName;
#[test]
fn test_client_disconnect() {
init_tracing();
let mut simulation = Simulation::new(ConnectionProtocol::Game);
simulation.disconnect();
simulation.tick();
// make sure we're disconnected
let is_connected = simulation.has_component::<InstanceName>();
assert!(!is_connected);
// tick again to make sure nothing goes wrong
simulation.tick();
}