First cut of pulling out the relevant parts of my original game to make a little framework.
This commit is contained in:
commit
6a0c9e8d46
177 changed files with 18197 additions and 0 deletions
24
tests/palette.cpp
Normal file
24
tests/palette.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <string>
|
||||
#include "graphics/palette.hpp"
|
||||
|
||||
using namespace fmt;
|
||||
|
||||
TEST_CASE("color palette test", "[color-palette]") {
|
||||
palette::init();
|
||||
REQUIRE(palette::initialized() == true);
|
||||
// confirm it's idempotent
|
||||
palette::init();
|
||||
|
||||
sf::Color expect{10, 10, 10, 255};
|
||||
|
||||
auto gui_text = palette::get("gui/theme:dark_dark");
|
||||
REQUIRE(gui_text == expect);
|
||||
|
||||
gui_text = palette::get("gui/theme", "mid");
|
||||
REQUIRE(gui_text != expect);
|
||||
|
||||
expect = {100, 100, 100, 255};
|
||||
REQUIRE(gui_text == expect);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue