Fixed handling of nested classes in templates and anonymous nested structs
This commit is contained in:
@@ -14,7 +14,8 @@ public:
|
||||
public:
|
||||
enum class Lights { Green, Yellow, Red };
|
||||
|
||||
class AAA { };
|
||||
class AAA {
|
||||
};
|
||||
};
|
||||
|
||||
void foo2() const { }
|
||||
@@ -25,7 +26,8 @@ public:
|
||||
T t;
|
||||
|
||||
class AA {
|
||||
class AAA { };
|
||||
class AAA {
|
||||
};
|
||||
|
||||
enum class CCC { CCC_1, CCC_2 };
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
namespace clanguml {
|
||||
namespace t00037 {
|
||||
|
||||
struct ST {
|
||||
class ST {
|
||||
public:
|
||||
struct {
|
||||
double t;
|
||||
double x;
|
||||
@@ -9,22 +10,20 @@ struct ST {
|
||||
double z;
|
||||
} dimensions;
|
||||
|
||||
private:
|
||||
struct {
|
||||
double c;
|
||||
double h;
|
||||
double c{1.0};
|
||||
double h{1.0};
|
||||
} units;
|
||||
};
|
||||
|
||||
struct A {
|
||||
A()
|
||||
{
|
||||
st.dimensions.t = -1;
|
||||
st.dimensions.x = 1;
|
||||
st.dimensions.y = 1;
|
||||
st.dimensions.z = 1;
|
||||
|
||||
st.units.c = 1;
|
||||
st.units.h = 1;
|
||||
st.dimensions.t = -1.0;
|
||||
st.dimensions.x = 1.0;
|
||||
st.dimensions.y = 1.0;
|
||||
st.dimensions.z = 1.0;
|
||||
}
|
||||
|
||||
ST st;
|
||||
|
||||
@@ -37,7 +37,12 @@ TEST_CASE("t00037", "[test-case][class]")
|
||||
|
||||
REQUIRE_THAT(puml, IsClass(_A("ST")));
|
||||
REQUIRE_THAT(puml, IsClass(_A("A")));
|
||||
REQUIRE_THAT(puml, IsClass(_A("ST::\\(anonymous_\\d+\\)")));
|
||||
REQUIRE_THAT(puml, IsClass(_A("ST::\\(units\\)")));
|
||||
REQUIRE_THAT(puml, IsClass(_A("ST::\\(dimensions\\)")));
|
||||
REQUIRE_THAT(puml,
|
||||
IsAggregation(_A("ST"), _A("ST::\\(dimensions\\)"), "+dimensions"));
|
||||
REQUIRE_THAT(
|
||||
puml, IsAggregation(_A("ST"), _A("ST::\\(units\\)"), "-units"));
|
||||
|
||||
save_puml(
|
||||
"./" + config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||
|
||||
Reference in New Issue
Block a user