container: root: test: unit: common: PluggablePath: update/add case for invalid family

This commit is contained in:
2025-12-23 09:00:41 -08:00
parent b775992d63
commit d2ff942fa0

View File

@@ -534,8 +534,8 @@ TEST_F(PluggablePath, Family_nested)
Path repo("repo" + std::string{"/"} + nested), Path repo("repo" + std::string{"/"} + nested),
custom("custom" + std::string{"/"} + nested); custom("custom" + std::string{"/"} + nested);
ASSERT_EQ(repo.parent(), kParent); ASSERT_EQ(repo.parent(), kParent + "/a_nested_dir");
ASSERT_EQ(custom.parent(), kParent); ASSERT_EQ(custom.parent(), kParent + "/a_nested_dir");
ASSERT_EQ(repo.child(), kChild); ASSERT_EQ(repo.child(), kChild);
ASSERT_EQ(custom.child(), kChild); ASSERT_EQ(custom.child(), kChild);
@@ -544,6 +544,26 @@ TEST_F(PluggablePath, Family_nested)
ASSERT_EQ(custom.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) TEST_F(PluggablePath, Base)
{ {
ASSERT_EQ(m_repo().repo(), kRepoBase); ASSERT_EQ(m_repo().repo(), kRepoBase);