File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change
1
+ function iswsl = is_wsl_path(path )
2
+ arguments
3
+ path (1 ,1 ) string
4
+ end
5
+
6
+ if ispc
7
+ iswsl = any(startsWith(path , [" \\wsl$" , " \\wsl.localhost" ]));
8
+ else
9
+ iswsl = false ;
10
+ end
11
+
12
+ end
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ function test_wsl_path(tc)
41
41
tc .verifyNotEmpty(wsl_temp , " could not get WSL tempfile" )
42
42
43
43
wsl_path = stdlib .sys .wslpath2winpath(wsl_temp );
44
- tc .verifyNotEmpty( wsl_path , " could not convert WSL path to Windows path" )
44
+ tc .verifyTrue( stdlib . fileio .is_wsl_path( wsl_path ) , " could not convert WSL path to Windows path" )
45
45
46
46
win_path = stdlib .sys .winpath2wslpath(wsl_path );
47
47
tc .verifyNotEmpty(win_path , " could not convert Windows path to WSL path" )
@@ -50,4 +50,4 @@ function test_wsl_path(tc)
50
50
51
51
end
52
52
53
- end
53
+ end
You can’t perform that action at this time.
0 commit comments