Fixed tests after refactoring namespace handling

This commit is contained in:
Bartek Kryza
2022-03-05 18:46:29 +01:00
parent a67b459437
commit f84e86ca6d
6 changed files with 14 additions and 39 deletions

View File

@@ -62,7 +62,7 @@ void element::set_using_namespaces(const namespace_ &un)
using_namespace_ = un;
}
const namespace_ &element::using_namespace() const { return ns_; }
const namespace_ &element::using_namespace() const { return using_namespace_; }
std::vector<relationship> &element::relationships() { return relationships_; }

View File

@@ -1,5 +1,5 @@
/**
* src/common/model/namespace.h
* src/common/model/namespace.cc
*
* Copyright (c) 2021-2022 Bartek Kryza <bkryza@gmail.com>
*
@@ -156,30 +156,6 @@ namespace_ namespace_::relative_to(const namespace_ &right) const
std::string namespace_::relative(const std::string &name) const
{
/*
std::vector<std::string> namespaces_sorted{namespaces};
std::sort(namespaces_sorted.rbegin(), namespaces_sorted.rend());
auto res = name;
for (const auto &ns : namespaces_sorted) {
if (ns.empty())
continue;
if (name == ns)
return split(n, "::").back();
auto ns_prefix = ns + "::";
auto it = res.find(ns_prefix);
while (it != std::string::npos) {
res.erase(it, ns_prefix.size());
it = res.find(ns_prefix);
}
}
return res;
*/
if (is_empty())
return name;