diff --git a/crates/servicepoint/src/connection.rs b/crates/servicepoint/src/connection.rs index 255c15a..224f370 100644 --- a/crates/servicepoint/src/connection.rs +++ b/crates/servicepoint/src/connection.rs @@ -80,3 +80,16 @@ impl Connection { } } } + +#[cfg(test)] +mod tests { + use super::*; + use crate::packet::*; + + #[test] + fn send_fake() { + let data: &[u8] = &[0u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + let packet = Packet::try_from(data).unwrap(); + Connection::Fake.send(packet).unwrap() + } +} diff --git a/crates/servicepoint/src/grid.rs b/crates/servicepoint/src/grid.rs index cb8f5e7..d367d98 100644 --- a/crates/servicepoint/src/grid.rs +++ b/crates/servicepoint/src/grid.rs @@ -79,12 +79,12 @@ pub trait Grid { assert!( x < self.width(), "cannot access index [{x}, {y}] because x is outside of bounds 0..{}", - self.width() + self.width() - 1 ); assert!( y < self.height(), - "cannot access byte [{x}, {y}] because y is outside of bounds 0..{}", - self.height() + "cannot access index [{x}, {y}] because y is outside of bounds 0..{}", + self.height() - 1 ); } }