Skip to content

Commit d3155eb

Browse files
antmarakisnorvig
authored andcommitted
Update test_grid.py (aimacode#448)
1 parent 6b64e77 commit d3155eb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/test_grid.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,24 @@ def test_vector_clip():
1818
assert vector_clip((-1, 10), (0, 0), (9, 9)) == (0, 9)
1919

2020

21+
def test_turn_heading():
22+
assert turn_heading((0, 1), 1) == (-1, 0)
23+
assert turn_heading((0, 1), -1) == (1, 0)
24+
assert turn_heading((1, 0), 1) == (0, 1)
25+
assert turn_heading((1, 0), -1) == (0, -1)
26+
assert turn_heading((0, -1), 1) == (1, 0)
27+
assert turn_heading((0, -1), -1) == (-1, 0)
28+
assert turn_heading((-1, 0), 1) == (0, -1)
29+
assert turn_heading((-1, 0), -1) == (0, 1)
30+
31+
32+
def test_turn_left():
33+
assert turn_left((0, 1)) == (-1, 0)
34+
35+
36+
def test_turn_right():
37+
assert turn_right((0, 1)) == (1, 0)
38+
39+
2140
if __name__ == '__main__':
2241
pytest.main()

0 commit comments

Comments
 (0)