From 79be6ef78807f91b7ef9f6f3a1298fc386742656 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Thu, 19 May 2022 00:09:58 +0200 Subject: [PATCH] Updated t00013 test case for variable template instantiation --- tests/t00013/t00013.cc | 7 +++++++ tests/t00013/test_case.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/tests/t00013/t00013.cc b/tests/t00013/t00013.cc index d96d0e84..d132b142 100644 --- a/tests/t00013/t00013.cc +++ b/tests/t00013/t00013.cc @@ -34,6 +34,11 @@ template struct E { T e; }; +template struct G { + T g; + std::tuple args; +}; + using namespace ABCD; class R { public: @@ -52,6 +57,8 @@ public: template T get_f(const F &f) { return f.f; } int get_int_f(const F &f) { return f.f; } + G gintstring; + private: mutable E estring; }; diff --git a/tests/t00013/test_case.h b/tests/t00013/test_case.h index 5bcf89c4..28f672b1 100644 --- a/tests/t00013/test_case.h +++ b/tests/t00013/test_case.h @@ -40,6 +40,9 @@ TEST_CASE("t00013", "[test-case][class]") REQUIRE_THAT(puml, IsClass(_A("B"))); REQUIRE_THAT(puml, IsClass(_A("C"))); REQUIRE_THAT(puml, IsClass(_A("D"))); + REQUIRE_THAT(puml, IsClassTemplate("E", "T")); + REQUIRE_THAT(puml, IsClassTemplate("G", "T,Args...")); + REQUIRE_THAT(puml, !IsDependency(_A("R"), _A("R"))); REQUIRE_THAT(puml, IsDependency(_A("R"), _A("A"))); REQUIRE_THAT(puml, IsDependency(_A("R"), _A("B"))); @@ -56,6 +59,9 @@ TEST_CASE("t00013", "[test-case][class]") REQUIRE_THAT(puml, IsInstantiation(_A("ABCD::F"), _A("F"))); REQUIRE_THAT(puml, IsDependency(_A("R"), _A("F"))); + REQUIRE_THAT(puml, + IsInstantiation(_A("G"), _A("G"))); + save_puml( "./" + config.output_directory() + "/" + diagram->name + ".puml", puml); }