Implement a simple config file parser
This commit is contained in:
parent
405b68b824
commit
167b8bee8d
20 changed files with 601 additions and 0 deletions
15
Tests/SimpleConf/Comments.cpp
Normal file
15
Tests/SimpleConf/Comments.cpp
Normal 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");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue