Switched component to package in package diagrams
This commit is contained in:
@@ -114,7 +114,7 @@ void generator::generate(const package &p, std::ostream &ostr) const
|
|||||||
{
|
{
|
||||||
const auto uns = m_config.using_namespace;
|
const auto uns = m_config.using_namespace;
|
||||||
|
|
||||||
ostr << "component [" << p.name() << "] as " << p.alias();
|
ostr << "package [" << p.name() << "] as " << p.alias();
|
||||||
|
|
||||||
if (!p.style().empty())
|
if (!p.style().empty())
|
||||||
ostr << " " << p.style();
|
ostr << " " << p.style();
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ TEST_CASE("t30001", "[test-case][package]")
|
|||||||
REQUIRE_THAT(puml, StartsWith("@startuml"));
|
REQUIRE_THAT(puml, StartsWith("@startuml"));
|
||||||
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
|
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
|
||||||
|
|
||||||
REQUIRE_THAT(puml, Contains("component [A]"));
|
REQUIRE_THAT(puml, IsPackage("A"));
|
||||||
REQUIRE_THAT(puml, Contains("component [AA]"));
|
REQUIRE_THAT(puml, IsPackage("AAA"));
|
||||||
REQUIRE_THAT(puml, Contains("component [AAA]"));
|
REQUIRE_THAT(puml, IsPackage("AAA"));
|
||||||
|
|
||||||
save_puml(
|
save_puml(
|
||||||
"./" + config.output_directory + "/" + diagram->name + ".puml", puml);
|
"./" + config.output_directory + "/" + diagram->name + ".puml", puml);
|
||||||
|
|||||||
@@ -46,19 +46,18 @@ TEST_CASE("t30002", "[test-case][package]")
|
|||||||
REQUIRE_THAT(puml, StartsWith("@startuml"));
|
REQUIRE_THAT(puml, StartsWith("@startuml"));
|
||||||
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
|
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
|
||||||
|
|
||||||
REQUIRE_THAT(puml, Contains("component [A1]"));
|
REQUIRE_THAT(puml, IsPackage("A1"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A2]"));
|
REQUIRE_THAT(puml, IsPackage("A2"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A3]"));
|
REQUIRE_THAT(puml, IsPackage("A3"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A4]"));
|
REQUIRE_THAT(puml, IsPackage("A4"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A5]"));
|
REQUIRE_THAT(puml, IsPackage("A5"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A6]"));
|
REQUIRE_THAT(puml, IsPackage("A6"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A7]"));
|
REQUIRE_THAT(puml, IsPackage("A7"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A8]"));
|
REQUIRE_THAT(puml, IsPackage("A8"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A9]"));
|
REQUIRE_THAT(puml, IsPackage("A9"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A10]"));
|
REQUIRE_THAT(puml, IsPackage("A11"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A11]"));
|
REQUIRE_THAT(puml, IsPackage("A12"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A12]"));
|
REQUIRE_THAT(puml, IsPackage("A13"));
|
||||||
REQUIRE_THAT(puml, Contains("component [A13]"));
|
|
||||||
|
|
||||||
REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A1")));
|
REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A1")));
|
||||||
REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A2")));
|
REQUIRE_THAT(puml, IsDependency(_A("BBB"), _A("A2")));
|
||||||
|
|||||||
@@ -179,9 +179,9 @@ struct AliasMatcher {
|
|||||||
patterns.push_back(
|
patterns.push_back(
|
||||||
std::regex{"enum\\s\"" + name + "\"\\sas\\s" + alias_regex});
|
std::regex{"enum\\s\"" + name + "\"\\sas\\s" + alias_regex});
|
||||||
patterns.push_back(
|
patterns.push_back(
|
||||||
std::regex{"component\\s\"" + name + "\"\\sas\\s" + alias_regex});
|
std::regex{"package\\s\"" + name + "\"\\sas\\s" + alias_regex});
|
||||||
patterns.push_back(
|
patterns.push_back(
|
||||||
std::regex{"component\\s\\[" + name + "\\]\\sas\\s" + alias_regex});
|
std::regex{"package\\s\\[" + name + "\\]\\sas\\s" + alias_regex});
|
||||||
|
|
||||||
std::smatch base_match;
|
std::smatch base_match;
|
||||||
|
|
||||||
@@ -419,7 +419,7 @@ ContainsMatcher IsPackage(std::string const &str,
|
|||||||
CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes)
|
CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes)
|
||||||
{
|
{
|
||||||
return ContainsMatcher(
|
return ContainsMatcher(
|
||||||
CasedString("component [" + str + "]", caseSensitivity));
|
CasedString("package [" + str + "]", caseSensitivity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user