From 5ffcb5174a9282c42c2140fb879d9bea8dd3d499 Mon Sep 17 00:00:00 2001 From: DimitriTimoz Date: Thu, 28 Dec 2023 17:45:38 +0100 Subject: [PATCH] Add positions tests --- minecraft-positions/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/minecraft-positions/src/lib.rs b/minecraft-positions/src/lib.rs index 5ce61492..08a147e4 100644 --- a/minecraft-positions/src/lib.rs +++ b/minecraft-positions/src/lib.rs @@ -349,3 +349,15 @@ impl std::cmp::Ord for LightPosition { } } +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn test_light_positions_conversions() { + let light_position = LightPosition { x: 1, y: 1, z: 1 }; + assert_eq!(light_position, LightPosition::from(BlockPosition::from(light_position.clone()))); + + let block_position = BlockPosition { x: 1, y: 1, z: 1 }; + assert_eq!(block_position, BlockPosition::from(LightPosition::from(block_position.clone()))); + } +}