Added comment() function support in package diagrams

This commit is contained in:
Bartek Kryza
2022-04-02 15:47:32 +02:00
parent 2d9f7c88f5
commit ffc6d56c4d
8 changed files with 52 additions and 18 deletions

View File

@@ -17,4 +17,6 @@ diagrams:
before:
- "' t30001 test package diagram"
after:
- 'note right of {{ alias("A::AA::AAA") }}: A AAA note...'
- 'note right of {{ alias("A::AA::AAA") }}: A AAA note...'
- 'note top of {{ alias("A::AA") }} : {{ comment("A::AA") }}'
- 'note top of {{ alias("B::AA") }} : {{ comment("B::AA") }}'

View File

@@ -1,6 +1,7 @@
namespace clanguml {
namespace t30001 {
namespace A {
/// This is namespace AA in namespace A
namespace AA {
namespace AAA {
} // namespace AAA
@@ -11,6 +12,7 @@ namespace BB {
} // namespace BB
} // namespace A
namespace B {
/// This is namespace AA in namespace B
namespace AA {
namespace AAA {
} // namespace AAA

View File

@@ -42,6 +42,12 @@ TEST_CASE("t30001", "[test-case][package]")
REQUIRE_THAT(puml, IsPackage("AAA"));
REQUIRE_THAT(puml, IsPackage("AAA"));
// TODO: Fix _A() to handle fully qualified names, right
// now it only finds the first element with unqalified
// name match
REQUIRE_THAT(
puml, HasNote(_A("AA"), "top", "This is namespace AA in namespace A"));
save_puml(
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
}