Now fully off catch2. YAY!

This commit is contained in:
Zed A. Shaw 2026-06-17 00:32:31 -04:00
parent 903cf00661
commit 21e7700deb
16 changed files with 610 additions and 498 deletions

View file

@ -1,24 +1,34 @@
#include <catch2/catch_test_macros.hpp>
#include <fuc2/testing.hpp>
#include <fmt/core.h>
#include <string>
#include "graphics/palette.hpp"
using namespace fmt;
using namespace fuc2;
TEST_CASE("color palette test", "[color-palette]") {
palette::init();
REQUIRE(palette::initialized() == true);
// confirm it's idempotent
palette::init();
namespace palette_tests {
void test_color_palette_test() {
palette::init();
CHECK(palette::initialized() == true);
// confirm it's idempotent
palette::init();
sf::Color expect{10, 10, 10, 255};
sf::Color expect{10, 10, 10, 255};
auto gui_text = palette::get("gui/theme:dark_dark");
REQUIRE(gui_text == expect);
auto gui_text = palette::get("gui/theme:dark_dark");
CHECK(gui_text == expect);
gui_text = palette::get("gui/theme", "mid");
REQUIRE(gui_text != expect);
gui_text = palette::get("gui/theme", "mid");
CHECK(gui_text != expect);
expect = {100, 100, 100, 255};
REQUIRE(gui_text == expect);
expect = {100, 100, 100, 255};
CHECK(gui_text == expect);
}
fuc2::Set TESTS{
.name="palette",
.tests={
TEST(test_color_palette_test),
}
};
}