Skip to content

Commit 5a5a869

Browse files
committed
makeParentCanonical: test case where parent is empty
1 parent 628c11d commit 5a5a869

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/libutil-tests/file-system.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,18 @@ TEST(pathExists, bogusPathDoesNotExist)
261261
{
262262
ASSERT_FALSE(pathExists("/schnitzel/darmstadt/pommes"));
263263
}
264+
265+
/* ----------------------------------------------------------------------------
266+
* makeParentCanonical
267+
* --------------------------------------------------------------------------*/
268+
269+
TEST(makeParentCanonical, noParent)
270+
{
271+
ASSERT_EQ(makeParentCanonical("file"), absPath(std::filesystem::path("file")));
272+
}
273+
274+
TEST(makeParentCanonical, root)
275+
{
276+
ASSERT_EQ(makeParentCanonical("/"), "/");
277+
}
264278
}

0 commit comments

Comments
 (0)