mirror of
https://github.com/kristoferssolo/hexlab.git
synced 2026-02-04 06:22:06 +00:00
feat(pathfinding): use pathfinding crate
This commit is contained in:
16
tests/pathfinding.rs
Normal file
16
tests/pathfinding.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
use claims::*;
|
||||
use hexlab::MazeBuilder;
|
||||
use hexx::{hex, Hex};
|
||||
|
||||
#[test]
|
||||
fn basic_path() {
|
||||
let maze = assert_ok!(MazeBuilder::new().with_seed(12345).with_radius(5).build());
|
||||
|
||||
let start = Hex::new(0, 0);
|
||||
let goal = Hex::new(2, 0);
|
||||
|
||||
assert_some_eq!(
|
||||
maze.find_path(start, goal),
|
||||
vec![start, hex(1, 0), hex(1, 1), hex(2, 1), goal]
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user