-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect path type rather than OS type when transferring files between …
…WSL and Windows filesystems (#8) * Now checks to see if it is a windows filepath rather that just running on windows when doing path translations. * Added a simple test to test various path types.
- Loading branch information
Showing
3 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from npu.build import wslpath, is_win_path, is_wsl_win_path | ||
|
||
def test_path_type_checks(): | ||
assert(is_win_path("C:\\Users\\dev\\Riallto\\npu\\lib\\kernels\\cpp\\*.h")) | ||
assert(is_win_path("C:\\Users\\dev\\Riallto\\npu\\lib\\kernels\\cpp\\file.h")) | ||
assert(is_win_path("C:\\Users\\dev\\Riallto\\npu\\lib\\kernels\\cpp\\file.h")) | ||
assert(not is_win_path("/mnt/c/Users/dev/test.cpp")) | ||
assert(not is_win_path("/mnt/c/Users/dev/*.h")) | ||
assert(is_wsl_win_path("\\\\wsl.localhost\\Riallto\\dev\\Riallto\\npu\\lib\\kernels\\cpp\\file.h")) | ||
assert(is_wsl_win_path("\\\\wsl.localhost\\Riallto\\dev\\Riallto\\npu\\lib\\kernels\\cpp\\*.h")) |