stuff-from-scratch/test/core/TestTomlReader.cpp
2022-11-30 18:28:50 +00:00

24 lines
615 B
C++

#include "TomlReader.h"
#include "TestFramework.h"
#include <filesystem>
#include <iostream>
TEST_CASE(TestTomlReader, "core")
{
const auto data_loc = std::filesystem::path(__FILE__) / "../../data";
const auto sample_toml_file = data_loc / "sample_toml.toml";
auto reader = TomlReader();
reader.read(sample_toml_file);
auto themes_table = reader.getContent()->getTable("themes");
REQUIRE(themes_table);
for (const auto& items : themes_table->getKeyValuePairs())
{
std::cout << "Got entry with key: " << items.first << " and val " << items.second << std::endl;
}
}