diff options
Diffstat (limited to 'tools/slang-test/unit-test-path.cpp')
| -rw-r--r-- | tools/slang-test/unit-test-path.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/slang-test/unit-test-path.cpp b/tools/slang-test/unit-test-path.cpp index ddaa39d6d..e9cfbe2e3 100644 --- a/tools/slang-test/unit-test-path.cpp +++ b/tools/slang-test/unit-test-path.cpp @@ -21,6 +21,21 @@ static void pathUnitTest() String parentPath2 = Path::GetDirectoryName(path); SLANG_CHECK(parentPath == parentPath2); } + // Test the paths + { + SLANG_CHECK(Path::Simplify(".") == "."); + SLANG_CHECK(Path::Simplify("..") == ".."); + SLANG_CHECK(Path::Simplify("blah/..") == "."); + + SLANG_CHECK(Path::Simplify("blah/.././a") == "a"); + + SLANG_CHECK(Path::Simplify("a:/what/.././../is/./../this/.") == "a:/../this"); + + SLANG_CHECK(Path::Simplify("a:/what/.././../is/./../this/./") == "a:/../this"); + + SLANG_CHECK(Path::Simplify("a:\\what\\..\\.\\..\\is\\.\\..\\this\\.\\") == "a:/../this"); + + } } SLANG_UNIT_TEST("Path", pathUnitTest);
\ No newline at end of file |
