Fixed class and include diagrams tests in Windows

This commit is contained in:
Bartek Kryza
2023-01-12 23:31:12 +01:00
parent 3fbf3da27f
commit ada11c6047
11 changed files with 58 additions and 14 deletions

View File

@@ -56,10 +56,12 @@ public:
explicit source_file(const std::filesystem::path &p)
{
set_path({p.parent_path().string()});
set_name(p.filename().string());
is_absolute_ = p.is_absolute();
set_id(common::to_id(p));
auto preferred = p;
preferred.make_preferred();
set_path({preferred.parent_path().string()});
set_name(preferred.filename().string());
is_absolute_ = preferred.is_absolute();
set_id(common::to_id(preferred));
}
void set_path(const filesystem_path &p) { path_ = p; }
@@ -118,6 +120,17 @@ public:
return res.lexically_normal();
}
inja::json context() const override
{
inja::json ctx = diagram_element::context();
std::filesystem::path fullNamePath{ctx["full_name"].get<std::string>()};
fullNamePath.make_preferred();
ctx["full_name"] = fullNamePath.string();
return ctx;
}
private:
filesystem_path path_;
source_file_t type_{source_file_t::kDirectory};