|
|
|
@ -41,10 +41,31 @@ TEST_CASE("brainfuck loop test", "[brainfuck]") { |
|
|
|
|
REQUIRE(output == expected); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST_CASE("game engine can start and take hit", "[brainfuck]") { |
|
|
|
|
TEST_CASE("game engine can start and take hit", "[game_engine]") { |
|
|
|
|
// test fails on purpose right now
|
|
|
|
|
GameEngine game{4}; |
|
|
|
|
string err{"error"}; |
|
|
|
|
game.start_round(); |
|
|
|
|
game.hit(err); |
|
|
|
|
game.end_round(); |
|
|
|
|
REQUIRE(game.is_dead() == true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST_CASE("", "[game_engine]") { |
|
|
|
|
// test fails on purpose right now
|
|
|
|
|
GameEngine game{100}; |
|
|
|
|
string err{"error"}; |
|
|
|
|
|
|
|
|
|
game.start_round(); |
|
|
|
|
game.hit(err); |
|
|
|
|
game.end_round(); |
|
|
|
|
|
|
|
|
|
REQUIRE(game.hit_points < 100); |
|
|
|
|
REQUIRE(game.is_dead() == false); |
|
|
|
|
|
|
|
|
|
game.start_round(); |
|
|
|
|
game.end_round(); |
|
|
|
|
|
|
|
|
|
REQUIRE(game.hit_points == 100); |
|
|
|
|
REQUIRE(game.is_dead() == false); |
|
|
|
|
} |
|
|
|
|