Fixed handling of relative paths on MSVC
This commit is contained in:
@@ -51,8 +51,8 @@ load_config(const std::string &test_name)
|
||||
|
||||
const auto compilation_database_dir = canonical(
|
||||
std::filesystem::current_path() / std::filesystem::path{".."});
|
||||
const auto output_directory =
|
||||
std::filesystem::current_path() / std::filesystem::path{"diagrams"};
|
||||
const auto output_directory = weakly_canonical(
|
||||
std::filesystem::current_path() / std::filesystem::path{"diagrams"});
|
||||
|
||||
res.first = clanguml::config::load(test_config_path, true, false, true);
|
||||
|
||||
|
||||
@@ -350,7 +350,11 @@ TEST_CASE("Test config relative paths handling", "[unit-test]")
|
||||
CHECK(cfg.diagrams.size() == 2);
|
||||
auto &def = *cfg.diagrams["class1"];
|
||||
CHECK(def.get_relative_to()() == "/tmp");
|
||||
CHECK(def.root_directory() == "/tmp");
|
||||
#ifdef _MSC_VER
|
||||
CHECK(def.root_directory().string() == "C:\\tmp");
|
||||
#else
|
||||
CHECK(def.root_directory().string() == "/tmp");
|
||||
#endif
|
||||
|
||||
def = *cfg.diagrams["class2"];
|
||||
CHECK(def.get_relative_to()() == ".");
|
||||
|
||||
Reference in New Issue
Block a user