23 lines
632 B
C++
23 lines
632 B
C++
#include <catch2/catch_test_macros.hpp>
|
|
#include <Garbage/SimpleConf.hpp>
|
|
|
|
TEST_CASE("Interactions with files")
|
|
{
|
|
SECTION("Try loading a nonexistent file")
|
|
{
|
|
using ReadError = Garbage::SimpleConfImplementation::ReadError;
|
|
|
|
std::filesystem::path path("TestConfigs/ThisOneShouldntExist.conf");
|
|
|
|
REQUIRE_THROWS_AS(Garbage::SimpleConf(path), ReadError);
|
|
}
|
|
|
|
SECTION("Try loading a directory")
|
|
{
|
|
using ReadError = Garbage::SimpleConfImplementation::ReadError;
|
|
|
|
std::filesystem::path path("TestConfigs");
|
|
|
|
REQUIRE_THROWS_AS(Garbage::SimpleConf(path), ReadError);
|
|
}
|
|
}
|