More tests converted to fuc2.
This commit is contained in:
parent
b8b42d5681
commit
903cf00661
10 changed files with 671 additions and 556 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <fuc2/testing.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <string>
|
||||
#include "game/components.hpp"
|
||||
|
|
@ -6,16 +6,26 @@
|
|||
|
||||
using namespace fmt;
|
||||
using namespace components;
|
||||
using namespace fuc2;
|
||||
|
||||
TEST_CASE("test the loot ui", "[loot]") {
|
||||
auto items = settings::get("assets/items.json");
|
||||
DinkyECS::World world;
|
||||
auto torch = world.entity();
|
||||
auto& data = items["TORCH_BAD"];
|
||||
namespace loot_tests {
|
||||
void test_test_the_loot_ui() {
|
||||
auto items = settings::get("assets/items.json");
|
||||
DinkyECS::World world;
|
||||
auto torch = world.entity();
|
||||
auto& data = items["TORCH_BAD"];
|
||||
|
||||
components::init();
|
||||
components::configure_entity(world, torch, data["components"]);
|
||||
components::init();
|
||||
components::configure_entity(world, torch, data["components"]);
|
||||
|
||||
auto& torch_sprite = world.get<Sprite>(torch);
|
||||
REQUIRE(torch_sprite.name == "torch_horizontal_floor");
|
||||
auto& torch_sprite = world.get<Sprite>(torch);
|
||||
CHECK(torch_sprite.name == "torch_horizontal_floor");
|
||||
}
|
||||
|
||||
fuc2::Set TESTS{
|
||||
.name="loot",
|
||||
.tests={
|
||||
TEST(test_test_the_loot_ui),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue