Skip to content

Commit ea0605a

Browse files
committed
test:short_path: correct
1 parent 88fbbb6 commit ea0605a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

+stdlib/windows_shortname.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
end
1616

1717
s = p;
18-
1918
if ispc
2019
fso = actxserver('Scripting.FileSystemObject');
2120

@@ -26,10 +25,10 @@
2625
end
2726

2827
delete(fso);
28+
end
2929

30-
if isstring(p)
31-
s = string(s);
32-
end
30+
if isstring(p)
31+
s = string(s);
3332
end
3433

3534
end

test/TestWindowsCOM.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function test_short_folder(tc)
2323

2424
if ispc
2525
tc.verifySubstring(short, "PROGRA~1")
26-
tc.verifyTrue(stdlib.samepath(short, string(progdir)))
26+
tc.verifyTrue(stdlib.samepath(short, progdir))
2727
else
2828
tc.verifyEqual(strlength(short), 0)
2929
end
@@ -40,7 +40,7 @@ function test_short_file(tc, Pmr)
4040
if contains(Pmr, " ")
4141
tc.verifySubstring(s, "~")
4242
end
43-
tc.verifyEqual(stdlib.canonical(s), string(stdlib.posix(Pmr)), "shortname didn't resolve same as canonical")
43+
tc.verifyEqual(stdlib.canonical(s), stdlib.posix(Pmr), "shortname didn't resolve same as canonical")
4444
else
4545
tc.verifyEqual(s, string(Pmr))
4646
end

0 commit comments

Comments
 (0)