Skip to content

Commit 7cab753

Browse files
committed
filesystem_type: use missing
1 parent d8ffa94 commit 7cab753

6 files changed

Lines changed: 10 additions & 11 deletions

File tree

+stdlib/+dotnet/filesystem_type.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
function t = filesystem_type(file)
44

55

6-
t = '';
6+
t = missing;
77
% Windows needs exists() not just strempty()
88
if ~stdlib.exists(file)
99
return

+stdlib/+java/filesystem_type.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
function t = filesystem_type(file)
55

6-
t = '';
6+
t = missing;
77
if stdlib.strempty(file)
88
return
99
end

+stdlib/+python/filesystem_type.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function t = filesystem_type(file)
22

3-
t = '';
3+
t = missing;
44

55
try
66
% important for heuristic matching

+stdlib/+shell/filesystem_type.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function [t, cmd] = filesystem_type(file)
22

3-
t = '';
3+
t = missing;
44

55
if ispc()
66
cmd = sprintf('pwsh -c ([System.IO.DriveInfo][System.IO.Path]::GetFullPath(''%s'')).DriveFormat', file);

+stdlib/filesystem_type.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
backend (1,:) string = ["java", "dotnet", "python", "shell"]
1616
end
1717

18-
r = '';
18+
r = missing;
1919

2020
for b = backend
2121
switch b
@@ -33,7 +33,7 @@
3333
error('stdlib:filesystem_type:ValueError', 'Unknown backend: %s', b)
3434
end
3535

36-
if ~isempty(r)
36+
if ~ismissing(r)
3737
return
3838
end
3939
end

test/TestDisk.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,17 @@ function test_hard_link_count(tc, B_jps)
121121
function test_filesystem_type(tc, Ps, B_jdps)
122122
[t, b] = stdlib.filesystem_type(Ps, B_jdps);
123123
tc.assertMatches(b, B_jdps)
124-
tc.verifyClass(t, 'char')
125124

126125
if ismember(B_jdps, stdlib.Backend().select('filesystem_type'))
127126
if ~stdlib.exists(Ps)
128-
tc.verifyEmpty(t)
127+
tc.verifyEqual(t, missing)
129128
else
130-
tc.assumeFalse(isempty(t) && tc.CI, 'Some CI block viewing their filesystem type')
131-
tc.assertNotEmpty(t)
129+
tc.verifyClass(t, 'char')
130+
tc.assumeFalse(any(ismissing(t)) && tc.CI, 'Some CI block viewing their filesystem type')
132131
tc.verifyGreaterThan(strlength(t), 0)
133132
end
134133
else
135-
tc.verifyEmpty(t)
134+
tc.verifyEqual(t, missing)
136135
end
137136
end
138137

0 commit comments

Comments
 (0)