Fixed path separators in diagram link URL's in Windows

This commit is contained in:
Bartek Kryza
2023-01-11 00:29:43 +01:00
parent c7d201eef9
commit 3fbf3da27f
4 changed files with 51 additions and 1 deletions

View File

@@ -169,3 +169,26 @@ TEST_CASE("Test parse_unexposed_template_params", "[unit-test]")
CHECK(declaration_template[1].type() == "Result");
CHECK(declaration_template[2].type() == "Tail");
}
TEST_CASE("Test path_to_url", "[unit-test]")
{
namespace fs = std::filesystem;
using namespace clanguml::util;
fs::path p1{""};
p1.make_preferred();
CHECK(path_to_url(p1) == "");
fs::path p2{"a/b/c/d"};
p2.make_preferred();
CHECK(path_to_url(p2) == "a/b/c/d");
fs::path p3{"/a/b/c/d"};
p3.make_preferred();
CHECK(path_to_url(p3) == "/a/b/c/d");
fs::path p4{"/"};
p4.make_preferred();
CHECK(path_to_url(p4) == "/");
}