Skip to content

Commit

Permalink
makeParentCanonical: test case where parent is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Dec 16, 2024
1 parent 0c9be56 commit 12d4c8d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/libutil-tests/file-system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,18 @@ TEST(pathExists, bogusPathDoesNotExist)
{
ASSERT_FALSE(pathExists("/schnitzel/darmstadt/pommes"));
}

/* ----------------------------------------------------------------------------
* makeParentCanonical
* --------------------------------------------------------------------------*/

TEST(makeParentCanonical, noParent)
{
ASSERT_EQ(makeParentCanonical("file"), absPath(std::filesystem::path("file")));
}

TEST(makeParentCanonical, root)
{
ASSERT_EQ(makeParentCanonical("/"), "/");
}
}

0 comments on commit 12d4c8d

Please sign in to comment.