From d2ff942fa04e7fb9d7fe53d4042dd91a2b6a05e3 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 23 Dec 2025 09:00:41 -0800 Subject: [PATCH] container: root: test: unit: common: PluggablePath: update/add case for invalid family --- container/src/root/test/unit/utility.hh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/container/src/root/test/unit/utility.hh b/container/src/root/test/unit/utility.hh index 5a310b8..96791a9 100644 --- a/container/src/root/test/unit/utility.hh +++ b/container/src/root/test/unit/utility.hh @@ -534,8 +534,8 @@ TEST_F(PluggablePath, Family_nested) Path repo("repo" + std::string{"/"} + nested), custom("custom" + std::string{"/"} + nested); - ASSERT_EQ(repo.parent(), kParent); - ASSERT_EQ(custom.parent(), kParent); + ASSERT_EQ(repo.parent(), kParent + "/a_nested_dir"); + ASSERT_EQ(custom.parent(), kParent + "/a_nested_dir"); ASSERT_EQ(repo.child(), kChild); ASSERT_EQ(custom.child(), kChild); @@ -544,6 +544,26 @@ TEST_F(PluggablePath, Family_nested) ASSERT_EQ(custom.family(), nested); } +TEST_F(PluggablePath, InvalidFamily) +{ + ASSERT_THROW(Path path(""), common::type::RuntimeError); + ASSERT_THROW(Path path("nope"), common::type::RuntimeError); + + ASSERT_THROW(Path path("repo/"), common::type::RuntimeError); + ASSERT_THROW(Path path("custom/"), common::type::RuntimeError); + + ASSERT_THROW(Path path("repo/incomplete"), common::type::RuntimeError); + ASSERT_THROW(Path path("custom/incomplete"), common::type::RuntimeError); + + ASSERT_THROW(Path path("repo/incomplete/"), common::type::RuntimeError); + ASSERT_THROW(Path path("custom/incomplete/"), common::type::RuntimeError); + + ASSERT_THROW( + Path path("repo/incomplete/incomplete"), common::type::RuntimeError); + ASSERT_THROW( + Path path("custom/incomplete/incomplete"), common::type::RuntimeError); +} + TEST_F(PluggablePath, Base) { ASSERT_EQ(m_repo().repo(), kRepoBase);