11classdef TestWindowsCOM < matlab .unittest .TestCase
22
33properties (TestParameter )
4- Pn = {" " }
4+ Pn = {{ " " , " " } }
55Pmr = {matlabroot, stdlib.posix(matlabroot)}
66end
77
88methods (Test )
99
1010function test_not(tc , Pn )
11- tc .verifyEqual(stdlib .windows_shortname(Pn ), " " )
11+ tc .verifyEqual(stdlib .windows_shortname(Pn{ 1 } ), Pn{ 2 } )
1212end
1313
1414function test_short_folder(tc )
1515import matlab .unittest .constraints .IsFolder
1616
17- progdir = stdlib .posix( getenv(" PROGRAMFILES" ) );
17+ progdir = getenv(" PROGRAMFILES" );
1818if ispc()
1919 tc .assertThat(progdir , IsFolder , " $Env:PROGRAMFILES is not a directory" )
2020end
@@ -32,19 +32,20 @@ function test_short_folder(tc)
3232
3333
3434function test_short_file(tc , Pmr )
35- import matlab .unittest .constraints .IsFile
3635
3736s = stdlib .windows_shortname(Pmr );
3837
3938if ispc
4039 if contains(Pmr , " " )
4140 tc .verifySubstring(s , " ~" )
4241 end
43- tc .verifyEqual(stdlib .canonical(s ), stdlib .posix(Pmr ), " shortname didn't resolve same as canonical" )
44- else
45- tc .verifyEqual(s , string(Pmr ))
42+
43+ tc .verifyLessThanOrEqual(strlength(s ), strlength(Pmr ))
4644end
4745
46+ tc .verifyTrue(stdlib .samepath(s , Pmr ),...
47+ sprintf(" mex: %d" , stdlib .is_mex_fun(" stdlib.windows_shortname" )))
48+
4849end
4950
5051end
0 commit comments