diff options
Diffstat (limited to 'Source/kwsys/testSystemTools.cxx')
-rw-r--r-- | Source/kwsys/testSystemTools.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx index 9a40b53..ffa6a29 100644 --- a/Source/kwsys/testSystemTools.cxx +++ b/Source/kwsys/testSystemTools.cxx @@ -684,9 +684,10 @@ static bool CheckRelativePaths() } static bool CheckCollapsePath(const std::string& path, - const std::string& expected) + const std::string& expected, + const char* base = nullptr) { - std::string result = kwsys::SystemTools::CollapseFullPath(path); + std::string result = kwsys::SystemTools::CollapseFullPath(path, base); if (!kwsys::SystemTools::ComparePath(expected, result)) { std::cerr << "CollapseFullPath(" << path << ") yielded " << result << " instead of " << expected << std::endl; @@ -710,6 +711,9 @@ static bool CheckCollapsePath() res &= CheckCollapsePath("C:/", "C:/"); res &= CheckCollapsePath("C:/../", "C:/"); res &= CheckCollapsePath("C:/../../", "C:/"); + res &= CheckCollapsePath("../b", "../../b", "../"); + res &= CheckCollapsePath("../a/../b", "../b", "../rel"); + res &= CheckCollapsePath("a/../b", "../rel/b", "../rel"); return res; } |