Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
Add positions tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriTimoz committed Dec 28, 2023
1 parent 23cc58b commit 5ffcb51
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions minecraft-positions/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())));
}
}

0 comments on commit 5ffcb51

Please sign in to comment.