Moved the game engine into its own unit and then made a failing test for it.

This commit is contained in:
Zed A. Shaw 2024-08-09 23:01:06 -04:00
parent fb5bf9d733
commit 440be444ea
7 changed files with 82 additions and 49 deletions

10
tests/game_engine.cpp Normal file
View 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);
}

View file

@ -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; }