From 736a71e9d1845bc896cf800ec84719a7018cedca Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 23 Dec 2025 11:02:26 -0800 Subject: [PATCH] container: root: test: unit: common: PluggablePath: add case for invalid characters --- container/src/root/test/unit/utility.hh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/container/src/root/test/unit/utility.hh b/container/src/root/test/unit/utility.hh index 96791a9..ce9f42e 100644 --- a/container/src/root/test/unit/utility.hh +++ b/container/src/root/test/unit/utility.hh @@ -564,6 +564,25 @@ TEST_F(PluggablePath, InvalidFamily) Path path("custom/incomplete/incomplete"), common::type::RuntimeError); } +TEST_F(PluggablePath, InvalidCharacters) +{ + ASSERT_THROW(Path path("repo/no spaces/a.file"), common::type::RuntimeError); + ASSERT_THROW( + Path path("custom/no spaces/a.file"), common::type::RuntimeError); + + ASSERT_THROW(Path path("repo/'no_ticks'/a.file"), common::type::RuntimeError); + ASSERT_THROW( + Path path("custom/'no_ticks'/a.file"), common::type::RuntimeError); + + ASSERT_THROW(Path path("repo/any/@a.file"), common::type::RuntimeError); + ASSERT_THROW(Path path("custom/any/@a.file"), common::type::RuntimeError); + + ASSERT_THROW( + Path path("repo/bad\\ slash/a.file"), common::type::RuntimeError); + ASSERT_THROW( + Path path("custom/bad\\ slash/a.file"), common::type::RuntimeError); +} + TEST_F(PluggablePath, Base) { ASSERT_EQ(m_repo().repo(), kRepoBase);