|
1 | 1 | classdef TestDisk < matlab.unittest.TestCase |
2 | 2 |
|
3 | 3 | properties |
4 | | -disk_fun = stdlib.has_python() || stdlib.has_dotnet() || stdlib.has_java() |
5 | 4 | CI = getenv("CI") == "true" || getenv("GITHUB_ACTIONS") == "true" |
6 | 5 | end |
7 | 6 |
|
8 | 7 | properties (TestParameter) |
9 | 8 | Ps = {".", "", "/", getenv("SystemDrive"), "not-exist"} |
| 9 | +Po = {mfilename("fullpath") + ".m", pwd(), ".", "", tempname()} |
10 | 10 | device_fun = {@stdlib.device, @stdlib.sys.device, @stdlib.java.device, @stdlib.python.device} |
11 | 11 | disk_available_fun = {@stdlib.disk_available, @stdlib.sys.disk_available, @stdlib.dotnet.disk_available, @stdlib.java.disk_available, @stdlib.python.disk_available} |
12 | 12 | disk_capacity_fun = {@stdlib.disk_capacity, @stdlib.sys.disk_capacity, @stdlib.dotnet.disk_capacity, @stdlib.java.disk_capacity, @stdlib.python.disk_capacity} |
| 13 | +owner_fun = {@stdlib.get_owner, @stdlib.sys.get_owner, @stdlib.dotnet.get_owner, @stdlib.java.get_owner, @stdlib.python.get_owner} |
13 | 14 | end |
14 | 15 |
|
15 | 16 | methods (Test) |
@@ -82,12 +83,19 @@ function test_inode(tc) |
82 | 83 | end |
83 | 84 |
|
84 | 85 |
|
85 | | -function test_owner(tc) |
| 86 | +function test_owner(tc, Po, owner_fun) |
| 87 | +is_capable(tc, owner_fun) |
86 | 88 |
|
87 | | -s = stdlib.get_owner(mfilename("fullpath") + ".m"); |
| 89 | +s = owner_fun(Po); |
88 | 90 |
|
89 | 91 | tc.verifyClass(s, 'string') |
90 | | -tc.verifyGreaterThan(strlength(s), 0) |
| 92 | + |
| 93 | +if stdlib.exists(Po) |
| 94 | + tc.verifyGreaterThan(strlength(s), 0) |
| 95 | +else |
| 96 | + tc.verifyEmpty(s) |
| 97 | +end |
| 98 | + |
91 | 99 | end |
92 | 100 |
|
93 | 101 | end |
|
0 commit comments