Moved the game engine into its own unit and then made a failing test for it.
This commit is contained in:
parent
fb5bf9d733
commit
440be444ea
7 changed files with 82 additions and 49 deletions
10
tests/game_engine.cpp
Normal file
10
tests/game_engine.cpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include <doctest.h>
|
||||
#include "../game_engine.hpp"
|
||||
|
||||
TEST_CASE("game engine can start and take hit") {
|
||||
// test fails on purpose right now
|
||||
GameEngine game{100};
|
||||
string err{"error"};
|
||||
game.hit(err);
|
||||
CHECK(game.is_dead() == true);
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
#include "doctest.h"
|
||||
#include <doctest.h>
|
||||
|
||||
int factorial(int number) { return number <= 1 ? number : factorial(number - 1) * number; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue