Skip to content

Commit c46e965

Browse files
committed
test symlink bc
1 parent c66075c commit c46e965

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

+stdlib/create_symlink.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
% For example, Matlab 25.1.0.2973910 R2025a Update 1 gave this error.
1212

1313
function [i, b] = create_symlink(target, link, backend)
14-
arguments
15-
target
16-
link
17-
backend (1,:) string = ["native", "dotnet", "python", "sys"]
14+
if nargin < 3
15+
backend = ["native", "dotnet", "python", "sys"];
16+
else
17+
backend = string(backend);
1818
end
1919

2020
i = logical.empty;

+stdlib/is_symlink.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
% * b: backend used
99

1010
function [i, b] = is_symlink(file, backend)
11-
arguments
12-
file
13-
backend (1,:) string = ["native", "java", "python", "dotnet", "sys"]
11+
if nargin < 2
12+
backend = ["native", "java", "python", "dotnet", "sys"];
13+
else
14+
backend = string(backend);
1415
end
1516

1617
i = logical.empty;

+stdlib/read_symlink.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
% * b: backend used
1212

1313
function [r, b] = read_symlink(file, backend)
14-
arguments
15-
file
16-
backend (1,:) string = ["native", "java", "dotnet", "python", "sys"]
14+
if nargin < 2
15+
backend = ["native", "java", "python", "dotnet", "sys"];
16+
else
17+
backend = string(backend);
1718
end
1819

1920

test/TestSymlink.m

Lines changed: 3 additions & 3 deletions
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', 'symlink', 'impure'}) ...
2+
TestTags = {'R2017b', 'symlink'}) ...
33
TestSymlink < matlab.unittest.TestCase
44

55
properties
@@ -21,7 +21,7 @@
2121
% needs to be per-method because multiple functions are used to make the same files
2222

2323
function setup_symlink(tc)
24-
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture())
24+
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture());
2525

2626
tc.link = fullfile(pwd(), 'my.lnk');
2727

@@ -75,7 +75,7 @@ function test_create_symlink(tc, B_create_symlink)
7575
tc.applyFixture(matlab.unittest.fixtures.SuppressedWarningsFixture(["MATLAB:io:filesystem:symlink:TargetNotFound","MATLAB:io:filesystem:symlink:FileExists"]))
7676

7777
ano = fullfile(pwd(), 'another.lnk');
78-
tc.assertThat(ano, ~matlab.unittest.constraints.IsFile)
78+
tc.assertFalse(isfile(ano))
7979
tc.assertFalse(stdlib.is_symlink(ano))
8080

8181
r = stdlib.create_symlink(tc.target, ano, B_create_symlink);

0 commit comments

Comments
 (0)