Implement a simple config file parser

This commit is contained in:
Viktor Soukup 2025-05-17 20:16:59 +02:00
parent 7744ac69f4
commit a04dd647f6
20 changed files with 601 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#include <catch2/catch_test_macros.hpp>
#include <Garbage/SimpleConf.hpp>
TEST_CASE("Comments and empty lines are ignored")
{
using Required = Garbage::SimpleConf::Required;
using LookupError = Garbage::SimpleConfImplementation::LookupError;
std::filesystem::path path("TestConfigs/Comments.conf");
Garbage::SimpleConf config(path);
REQUIRE_THROWS_AS((config.Get<std::string, Required>("this shouldn't")), LookupError);
REQUIRE(config.Get<std::string, Required>("while this") == "is accessible");
}