A simple config loader test.

This commit is contained in:
Zed A. Shaw 2025-02-21 23:17:53 -05:00
parent b8bb49df2c
commit 947ccbe180
4 changed files with 24 additions and 4 deletions

18
tests/config.cpp Normal file
View file

@ -0,0 +1,18 @@
#include <catch2/catch_test_macros.hpp>
#include "config.hpp"
#include <iostream>
TEST_CASE("confirm basic config loader ops", "[config]") {
Config config("assets/devices.json");
auto data_list = config.json();
for(auto& [key, data] : data_list.items()) {
auto wide1 = config.wstring(key, "name");
auto& comps = data["components"];
for(auto& comp_data : comps) {
REQUIRE(comp_data.contains("_type"));
}
}
}