Skip to content

Commit

Permalink
Add explicit unit tests for File::findEntry method
Browse files Browse the repository at this point in the history
  • Loading branch information
Master92 committed Dec 5, 2023
1 parent d7843dc commit 90461f9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/FileTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ TEST_CASE("Call findSection to get a non-existing Section")
CHECK_EQ(section, nullptr);
}

TEST_CASE("Call findEntry to get an existing Entry")
{
const auto f = File{fileName};
const auto entry = f.findEntry("Section1.Entry1");
REQUIRE(entry);
CHECK_EQ(entry->value<std::string_view>(), "Value1"sv);
}

TEST_CASE("Call findEntry with a non-existing section")
{
const auto f = File{fileName};
const auto entry = f.findEntry("Section2.Entry1");
CHECK_EQ(entry, nullptr);
}

TEST_CASE("Equality operator")
{
const auto f = File{fileName};
Expand Down

0 comments on commit 90461f9

Please sign in to comment.