diff options
Diffstat (limited to 'tools/slang-test/unit-test-path.cpp')
| -rw-r--r-- | tools/slang-test/unit-test-path.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/slang-test/unit-test-path.cpp b/tools/slang-test/unit-test-path.cpp new file mode 100644 index 000000000..ddaa39d6d --- /dev/null +++ b/tools/slang-test/unit-test-path.cpp @@ -0,0 +1,26 @@ +// unit-test-path.cpp + +#include "../../source/core/slang-io.h" + + +#include "test-context.h" + +using namespace Slang; + +static void pathUnitTest() +{ + { + String path; + SlangResult res = Path::GetCanonical(".", path); + SLANG_CHECK(SLANG_SUCCEEDED(res)); + + String parentPath; + res = Path::GetCanonical("..", parentPath); + SLANG_CHECK(SLANG_SUCCEEDED(res)); + + String parentPath2 = Path::GetDirectoryName(path); + SLANG_CHECK(parentPath == parentPath2); + } +} + +SLANG_UNIT_TEST("Path", pathUnitTest);
\ No newline at end of file |
