diff options
| author | mat <git@matdoes.dev> | 2023-08-25 02:34:31 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-08-25 02:34:31 -0500 |
| commit | d5465cd28e43d48b3e913fdb1161eb907e4d80d0 (patch) | |
| tree | b0962ac1bd09b434c67296c038ef3b26245ce6d7 /azalea/src/pathfinder/moves.rs | |
| parent | 9c31f8033f006d5f505ce97e359638d6c1136859 (diff) | |
| download | azalea-drasl-d5465cd28e43d48b3e913fdb1161eb907e4d80d0.tar.xz | |
add basic pathfinding test
Diffstat (limited to 'azalea/src/pathfinder/moves.rs')
| -rw-r--r-- | azalea/src/pathfinder/moves.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/azalea/src/pathfinder/moves.rs b/azalea/src/pathfinder/moves.rs index 04e2e725..0cc211ac 100644 --- a/azalea/src/pathfinder/moves.rs +++ b/azalea/src/pathfinder/moves.rs @@ -192,17 +192,17 @@ mod tests { partial_world.chunks.set_block_state( &BlockPos::new(0, 0, 0), azalea_registry::Block::Stone.into(), - &mut chunk_storage, + &chunk_storage, ); partial_world.chunks.set_block_state( &BlockPos::new(0, 1, 0), BlockState::AIR, - &mut chunk_storage, + &chunk_storage, ); let world = chunk_storage.into(); - assert_eq!(is_block_passable(&BlockPos::new(0, 0, 0), &world), false); - assert_eq!(is_block_passable(&BlockPos::new(0, 1, 0), &world), true); + assert!(!is_block_passable(&BlockPos::new(0, 0, 0), &world)); + assert!(is_block_passable(&BlockPos::new(0, 1, 0), &world)); } #[test] @@ -217,17 +217,17 @@ mod tests { partial_world.chunks.set_block_state( &BlockPos::new(0, 0, 0), azalea_registry::Block::Stone.into(), - &mut chunk_storage, + &chunk_storage, ); partial_world.chunks.set_block_state( &BlockPos::new(0, 1, 0), BlockState::AIR, - &mut chunk_storage, + &chunk_storage, ); let world = chunk_storage.into(); - assert_eq!(is_block_solid(&BlockPos::new(0, 0, 0), &world), true); - assert_eq!(is_block_solid(&BlockPos::new(0, 1, 0), &world), false); + assert!(is_block_solid(&BlockPos::new(0, 0, 0), &world)); + assert!(!is_block_solid(&BlockPos::new(0, 1, 0), &world)); } #[test] @@ -242,22 +242,22 @@ mod tests { partial_world.chunks.set_block_state( &BlockPos::new(0, 0, 0), azalea_registry::Block::Stone.into(), - &mut chunk_storage, + &chunk_storage, ); partial_world.chunks.set_block_state( &BlockPos::new(0, 1, 0), BlockState::AIR, - &mut chunk_storage, + &chunk_storage, ); partial_world.chunks.set_block_state( &BlockPos::new(0, 2, 0), BlockState::AIR, - &mut chunk_storage, + &chunk_storage, ); partial_world.chunks.set_block_state( &BlockPos::new(0, 3, 0), BlockState::AIR, - &mut chunk_storage, + &chunk_storage, ); let world = chunk_storage.into(); |
