Skip to content

Commit 1bea3c0

Browse files
committed
set_modtime backward compatible
1 parent 0987c37 commit 1bea3c0

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

+stdlib/set_modtime.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
% * i: true if successful
99
% * b: backend used
1010

11-
function [i, b] = set_modtime(file, t, backend)
12-
arguments
13-
file
14-
t (1,1) datetime
15-
backend (1,:) string = ["java", "python", "sys"]
11+
function [i, b] = set_modtime(file, time, backend)
12+
if nargin < 3
13+
backend = ["java", "python", "sys"];
14+
else
15+
backend = string(backend);
1616
end
1717

1818
i = logical.empty;
1919

2020
for b = backend
2121
switch b
2222
case "java"
23-
i = stdlib.java.set_modtime(file, t);
23+
i = stdlib.java.set_modtime(file, time);
2424
case "python"
2525
if stdlib.matlabOlderThan('R2022a'), continue, end
26-
i = stdlib.python.set_modtime(file, t);
26+
i = stdlib.python.set_modtime(file, time);
2727
case "sys"
28-
i = stdlib.sys.set_modtime(file, t);
28+
i = stdlib.sys.set_modtime(file, time);
2929
otherwise
3030
error("stdlib:set_modtime:ValueError", "Unknown backend: %s", b)
3131
end

test/TestResolve.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
classdef (SharedTestFixtures={ matlab.unittest.fixtures.PathFixture(fileparts(fileparts(mfilename('fullpath'))))}, ...
2-
TestTags = {'R2018b'}) ...
2+
TestTags = {'R2017b'}) ...
33
TestResolve < matlab.unittest.TestCase
44

55
properties (TestParameter)

test/TestTime.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
classdef (SharedTestFixtures={ matlab.unittest.fixtures.PathFixture(fileparts(fileparts(mfilename('fullpath'))))}, ...
2-
TestTags = {'R2019b', 'impure'}) ...
2+
TestTags = {'R2017b'}) ...
33
TestTime < matlab.unittest.TestCase
44

55
properties (TestParameter)

0 commit comments

Comments
 (0)