Skip to content

Commit

Permalink
Add test for high-cost but accessible goal
Browse files Browse the repository at this point in the history
  • Loading branch information
romlok committed Apr 19, 2019
1 parent e4f4f92 commit d28b7ce
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unit/test_pathfinding.gd
Expand Up @@ -317,3 +317,15 @@ func test_obstacle_neighbour():
]
check_path(grid.find_path(a_pos, f_pos), path)

func test_difficult_goal():
# We should be able to path to a goal, no matter how difficult the final step
grid.add_obstacles(f_pos, 1337)
var path = [
a_pos,
Vector2(1, 1),
Vector2(0, 2),
Vector2(0, 3),
f_pos,
]
check_path(grid.find_path(a_pos, f_pos), path)

0 comments on commit d28b7ce

Please sign in to comment.