Added test case for package diagram from modules dependencies

This commit is contained in:
Bartek Kryza
2023-12-22 21:23:53 +01:00
parent a8d646d1bc
commit 913ccb6bdf
28 changed files with 395 additions and 9 deletions

View File

@@ -301,13 +301,18 @@ tvl::value_t modules_filter::match(
if (!e.module().has_value())
return {false};
const auto module_toks = util::split(e.module().value(), "."); // NOLINT
auto module_toks = util::split(e.module().value(), ".", true); // NOLINT
if (dynamic_cast<const package *>(&e) != nullptr &&
e.get_namespace().type() == path_type::kModule) {
module_toks.push_back(e.name());
}
auto result = tvl::any_of(modules_.begin(), modules_.end(),
[&e, &module_toks](const auto &modit) {
if (std::holds_alternative<std::string>(modit.value())) {
const auto &modit_str = std::get<std::string>(modit.value());
const auto modit_toks = util::split(modit_str, ".");
const auto modit_toks = util::split(modit_str, ".", true);
return e.module() == modit_str ||
util::starts_with(module_toks, modit_toks);