diff options
| author | Yong He <yonghe@outlook.com> | 2021-09-24 11:33:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-24 11:33:44 -0700 |
| commit | bec8e6aec85b6e3f875c58bdd59eb15613978358 (patch) | |
| tree | 0791fb2ce1be786c17e5a6ee489ed3065fc07332 /tools/slang-test/unit-test-path.cpp | |
| parent | f2a3c933bc11a498c622fa18694c84beca8ca031 (diff) | |
Move existing unit tests to a standalone dll. (#1945)
Diffstat (limited to 'tools/slang-test/unit-test-path.cpp')
| -rw-r--r-- | tools/slang-test/unit-test-path.cpp | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/tools/slang-test/unit-test-path.cpp b/tools/slang-test/unit-test-path.cpp deleted file mode 100644 index 98f44753e..000000000 --- a/tools/slang-test/unit-test-path.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// unit-test-path.cpp - -#include "../../source/core/slang-io.h" - - -#include "test-context.h" - -using namespace Slang; - -static void pathUnitTest() -{ -#if SLANG_WINDOWS_FAMILY - // Disable for now on non windows has some problems on *some* Linux based CI. - { - String path; - SlangResult res = Path::getCanonical("source/slang", path); - SLANG_CHECK(SLANG_SUCCEEDED(res)); - - String parentPath; - res = Path::getCanonical("source", parentPath); - SLANG_CHECK(SLANG_SUCCEEDED(res)); - - String parentPath2 = Path::getParentDirectory(path); - SLANG_CHECK(parentPath == parentPath2); - } -#endif - // 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_CHECK(Path::simplify("tests/preprocessor/.\\pragma-once-a.h") == "tests/preprocessor/pragma-once-a.h"); - - - SLANG_CHECK(Path::hasRelativeElement(".")); - SLANG_CHECK(Path::hasRelativeElement("..")); - SLANG_CHECK(Path::hasRelativeElement("blah/..")); - - SLANG_CHECK(Path::hasRelativeElement("blah/.././a")); - SLANG_CHECK(Path::hasRelativeElement("a") == false); - SLANG_CHECK(Path::hasRelativeElement("blah/a") == false); - SLANG_CHECK(Path::hasRelativeElement("a:\\blah/a") == false); - - - SLANG_CHECK(Path::hasRelativeElement("a:/what/.././../is/./../this/.")); - - SLANG_CHECK(Path::hasRelativeElement("a:/what/.././../is/./../this/./")); - - SLANG_CHECK(Path::hasRelativeElement("a:\\what\\..\\.\\..\\is\\.\\..\\this\\.\\")); - - - } -} - -SLANG_UNIT_TEST("Path", pathUnitTest); |
