Fixed template namespace filter in class diagrams

This commit is contained in:
Bartek Kryza
2022-01-30 18:30:35 +01:00
parent 5ada8cdeee
commit 54b378dc71
2 changed files with 4 additions and 4 deletions

View File

@@ -360,8 +360,7 @@ void generator::generate(std::ostream &ostr) const
if (m_config.should_include_entities("classes")) { if (m_config.should_include_entities("classes")) {
for (const auto &c : m_model.classes()) { for (const auto &c : m_model.classes()) {
if (!c.is_template_instantiation() && if (!m_config.should_include(c.name()))
!m_config.should_include(c.name()))
continue; continue;
generate_alias(c, ostr); generate_alias(c, ostr);
ostr << '\n'; ostr << '\n';
@@ -375,8 +374,7 @@ void generator::generate(std::ostream &ostr) const
} }
for (const auto &c : m_model.classes()) { for (const auto &c : m_model.classes()) {
if (!c.is_template_instantiation() && if (!m_config.should_include(c.name()))
!m_config.should_include(c.name()))
continue; continue;
generate(c, ostr); generate(c, ostr);
ostr << '\n'; ostr << '\n';

View File

@@ -44,6 +44,8 @@ TEST_CASE("t00014", "[test-case][class]")
REQUIRE_THAT(puml, IsClassTemplate("A", "T,std::string")); REQUIRE_THAT(puml, IsClassTemplate("A", "T,std::string"));
REQUIRE_THAT(puml, IsClassTemplate("A", "bool,std::string")); REQUIRE_THAT(puml, IsClassTemplate("A", "bool,std::string"));
REQUIRE_THAT(puml, IsClassTemplate("AString", "float")); REQUIRE_THAT(puml, IsClassTemplate("AString", "float"));
REQUIRE_THAT(
puml, !IsClassTemplate("std::std::function", "void(T...,int),int)"));
REQUIRE_THAT(puml, IsInstantiation(_A("A<T,P>"), _A("A<T,std::string>"))); REQUIRE_THAT(puml, IsInstantiation(_A("A<T,P>"), _A("A<T,std::string>")));
REQUIRE_THAT( REQUIRE_THAT(