Skip to content

Commit bc7352a

Browse files
committed
compatibility
1 parent 8cdf9ba commit bc7352a

File tree

12 files changed

+21
-41
lines changed

12 files changed

+21
-41
lines changed

+stdlib/+sys/is_removable.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
%% SYS.IS_REMOVABLE
22

33
function y = is_removable(filepath)
4-
arguments
5-
filepath (1,1) string
6-
end
74

85
y = false;
96

@@ -14,7 +11,7 @@
1411
end
1512
r = extractBefore(r, 2);
1613

17-
psFile = fullfile(fileparts(mfilename('fullpath')), "isRemovableDrive.ps1");
14+
psFile = fullfile(fileparts(mfilename('fullpath')), 'isRemovableDrive.ps1');
1815
mustBeFile(psFile)
1916

2017
psCmd = sprintf('. ''%s''; IsRemovableDrive -DriveLetter ''%s''', psFile, r);

+stdlib/matlab_bin_path.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
mpaths.arch = computer("arch");
1010
mpaths.root = matlabroot;
1111

12-
mpaths.bin = fullfile(matlabroot, "bin");
12+
mpaths.bin = fullfile(matlabroot, 'bin');
1313

14-
mpaths.extern_bin = fullfile(matlabroot, "extern/bin", mpaths.arch);
14+
mpaths.extern_bin = fullfile(matlabroot, 'extern/bin', mpaths.arch);
1515

1616
mpaths.arch_bin = fullfile(mpaths.bin, mpaths.arch);
1717

18-
end
18+
end

+stdlib/samepath.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
% * b: backend used
1818

1919
function [i, b] = samepath(path1, path2, backend)
20-
arguments
21-
path1
22-
path2
23-
backend (1,:) string = ["python", "java", "perl", "sys", "native"]
20+
if nargin < 3
21+
backend = ["python", "java", "perl", "sys", "native"];
22+
else
23+
backend = string(backend);
2424
end
2525

2626
i = logical.empty;

buildfile.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
if ~isfolder(reportDir)
1515
mkdir(reportDir);
1616
end
17-
pkg_root = fullfile(plan.RootFolder, "+stdlib");
18-
test_root = fullfile(plan.RootFolder, "test");
17+
pkg_root = fullfile(plan.RootFolder, '+stdlib');
18+
test_root = fullfile(plan.RootFolder, 'test');
1919

2020
if ~isMATLABReleaseOlderThan("R2023b")
2121
plan("clean") = matlab.buildtool.tasks.CleanTask();
@@ -114,7 +114,7 @@ function publishTask(context)
114114
pkg_name = '+stdlib';
115115
pkg_root = fullfile(context.Plan.RootFolder, pkg_name);
116116
html_dir = fullfile(pkg_root, 'html');
117-
contents = fullfile(pkg_root, "Contents.m");
117+
contents = fullfile(pkg_root, 'Contents.m');
118118

119119
% styleFile = fullfile(context.Plan.RootFolder, "private/style.css");
120120
%

example/BenchmarkIsExe.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
BenchmarkIsExe < matlab.perftest.TestCase
33

44
properties
5-
exist = fullfile(matlabroot, "bin/matlab")
5+
exist = fullfile(matlabroot, 'bin/matlab')
66
end
77

88
properties (TestParameter)

example/TestMex.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function test_remove_recursive(tc)
3737

3838
d = tc.createTemporaryFolder();
3939

40-
tc.assumeTrue(stdlib.touch(fullfile(d, "junk.txt")))
40+
tc.assumeTrue(stdlib.touch(fullfile(d, 'junk.txt')))
4141
tc.verifyFalse(stdlib.remove(d), "should not remove directory recursively")
4242
end
4343

example/bench_absolute.m

Lines changed: 0 additions & 12 deletions
This file was deleted.

scripts/MatlabReleaseUpgrade.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function MatlabReleaseUpgrade()
4949

5050
function exe = legacy_update_path(name)
5151

52-
r = fullfile(matlabroot, "bin", computer("arch"));
52+
r = fullfile(matlabroot, 'bin', computer("arch"));
5353
mustBeFolder(r)
5454
exe = fullfile(r, name);
5555

@@ -74,9 +74,9 @@ function MatlabReleaseUpgrade()
7474
end
7575
mustBeFolder(head)
7676

77-
bin_tail = fullfile("bin", arch);
77+
bin_tail = fullfile('bin', arch);
7878

79-
infoFile = fullfile(head, "LatestInstall.info");
79+
infoFile = fullfile(head, 'LatestInstall.info');
8080
mustBeFile(infoFile)
8181
fid = fopen(infoFile);
8282
while ~feof(fid)

test/TestHDF4.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,22 @@
33
TestHDF4 < matlab.unittest.TestCase
44

55
properties
6-
file
6+
file = fullfile(matlabroot, 'toolbox/matlab/demos/example.hdf')
77
end
88

99
methods (TestClassSetup)
10-
function setup_file(tc)
11-
tc.file = fullfile(matlabroot, "toolbox/matlab/demos/example.hdf");
10+
function check_file(tc)
1211
tc.assumeThat(tc.file, matlab.unittest.constraints.IsFile)
1312
end
1413
end
1514

1615
methods (Test)
1716

1817
function test_exists(tc)
19-
import matlab.unittest.constraints.IsScalar
2018

2119
e = stdlib.h4exists(tc.file, "Example SDS");
2220

23-
tc.verifyThat(e, IsScalar)
21+
tc.verifyThat(e, matlab.unittest.constraints.IsScalar)
2422
tc.verifyTrue(e);
2523

2624
tc.verifyFalse(stdlib.h4exists(tc.file, "/j"))

test/TestIni.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ function test_example(tc)
1010
cwd = fileparts(mfilename('fullpath'));
1111
example = cwd + "/example.ini";
1212

13-
tc.assertThat(example, matlab.unittest.constraints.IsFile)
14-
1513
s = stdlib.ini2struct(example);
1614
tc.verifyClass(s, 'struct')
1715
tc.verifyEqual(s.DATA.keyNum, 113);

0 commit comments

Comments
 (0)