A simple config loader test.
This commit is contained in:
parent
b8bb49df2c
commit
947ccbe180
4 changed files with 24 additions and 4 deletions
18
tests/config.cpp
Normal file
18
tests/config.cpp
Normal 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"));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue