File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1515end
1616
1717s = p ;
18+
1819if ispc
1920 fso = actxserver(' Scripting.FileSystemObject' );
2021
2526 end
2627
2728 delete(fso );
28- end
29-
30- s = string(s );
3129
30+ if isstring(p )
31+ s = string(s );
32+ end
33+ end
3234
3335end
3436
Original file line number Diff line number Diff line change @@ -15,15 +15,17 @@ function test_short_folder(tc)
1515import matlab .unittest .constraints .IsFolder
1616
1717progdir = stdlib .posix(getenv(" PROGRAMFILES" ));
18- tc .assumeThat(progdir , IsFolder , " $Env:PROGRAMFILES is not a directory" )
18+ if ispc()
19+ tc .assertThat(progdir , IsFolder , " $Env:PROGRAMFILES is not a directory" )
20+ end
1921
2022short = stdlib .windows_shortname(progdir );
2123
2224if ispc
2325 tc .verifySubstring(short , " PROGRA~1" )
24- tc .verifyEqual (stdlib .canonical (short ) , string(progdir ))
26+ tc .verifyTrue (stdlib .samepath (short , string(progdir ) ))
2527else
26- tc .verifyEqual(short , progdir )
28+ tc .verifyEqual(strlength( short ), 0 )
2729end
2830
2931end
You can’t perform that action at this time.
0 commit comments