diff --git a/src/main/c/labyrinth.c b/src/main/c/labyrinth.c index adaaab5..d53c95b 100644 --- a/src/main/c/labyrinth.c +++ b/src/main/c/labyrinth.c @@ -13,5 +13,8 @@ void turn_direction_right(Direction *direction){ case E: *direction = S; break; + case S: + *direction = W; + break; } } diff --git a/src/test/c/test_labyrinth.c b/src/test/c/test_labyrinth.c index 563d886..555736d 100644 --- a/src/test/c/test_labyrinth.c +++ b/src/test/c/test_labyrinth.c @@ -37,3 +37,17 @@ void test_turn_direction_right_from_E_expected_S(void) /* assert */ TEST_ASSERT_TRUE(expected == actual); } + +void test_turn_direction_right_from_S_expected_W(void) +{ + /* arrange */ + Direction actual = S; + Direction expected = W; + + /* act */ + turn_direction_right(&actual); + + /* assert */ + TEST_ASSERT_TRUE(expected == actual); +} +