diff --git a/phlex/core/product_selector.cpp b/phlex/core/product_selector.cpp index ccefde092..d754ffb66 100644 --- a/phlex/core/product_selector.cpp +++ b/phlex/core/product_selector.cpp @@ -71,10 +71,23 @@ namespace phlex { std::string product_selector::to_string() const { - if (suffix) { - return fmt::format("{}/{} ϵ {}", creator, *suffix, layer); - } - return fmt::format("{} ϵ {}", creator, layer); + // Will generate <:: by (of ) in > + using experimental::identifier; + std::string_view suffix_str = + suffix.transform(&identifier::operator std::string_view).value_or("[ANY]"); + std::string type_str = this->type.valid() ? fmt::format("<{}>", this->type) + : "[UNSET TYPE]"; // will later be concept + auto layer_str = std::string_view(layer); + std::string_view creator_str = creator ? std::string_view(*creator) : "[ANY]"; + std::string_view stage_str = + stage.transform(&identifier::operator std::string_view).value_or("[ANY]"); + + return fmt::format("", + suffix_str, + type_str, + creator_str, + stage_str, + layer_str); } bool product_selector::operator==(product_selector const& rhs) const diff --git a/phlex/core/product_selector.hpp b/phlex/core/product_selector.hpp index 199c84996..83d52eed0 100644 --- a/phlex/core/product_selector.hpp +++ b/phlex/core/product_selector.hpp @@ -69,6 +69,7 @@ namespace phlex { // NOLINTNEXTLINE(google-explicit-constructor) - Implicit conversion is intentional operator T const&() const noexcept { return content_; } + explicit operator std::string_view() const noexcept { return std::string_view(content_); } bool operator==(required_layer_name const&) const noexcept = default; private: diff --git a/test/provider_test.cpp b/test/provider_test.cpp index 4c9e15091..f0618ad4c 100644 --- a/test/provider_test.cpp +++ b/test/provider_test.cpp @@ -170,9 +170,9 @@ TEST_CASE("Throw when two implicit providers are found for the same product") CHECK_THROWS_WITH( g.execute(), - ContainsSubstring( - "Multiple implicit providers found for product 'vertices_maker/happy_vertices") && - ContainsSubstring("spill") && ContainsSubstring("passer")); + ContainsSubstring("Multiple implicit providers found for product '