Skip to content

Commit

Permalink
fix(tests): new test for utils module
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Nov 6, 2024
1 parent 15a93c1 commit 94b14d6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ fn in_direction_end_oob() {
assert_eq!(in_direction((0, 7), (-1, 1), (8, 8)).next(), None);
}

#[test]
fn in_direction_invalid() {
assert_eq!(in_direction((0, 8), (-1, 1), (8, 8)).next(), None);
assert_eq!(in_direction((8, 0), (-1, 1), (8, 8)).next(), None);
assert_eq!(in_direction((0, 7), (0, 0), (8, 8)).next(), None);
}

#[test]
fn in_direction_valid() {
assert_eq!(move_in_direction((1, 1), (1, 3), (2, 4)), None);
Expand Down

0 comments on commit 94b14d6

Please sign in to comment.