Skip to content

Commit ba53946

Browse files
committed
test: remove unnecessary stdlib.join use
1 parent 1288a98 commit ba53946

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

test/TestFileImpure.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
end
66

77
properties(TestParameter)
8-
p_exists = {{pwd, true}, {mfilename("fullpath") + ".m", true}, {tempname, false}}
8+
p_exists = {{pwd(), true}, {mfilename("fullpath") + ".m", true}, {tempname, false}}
99
% on CI matlabroot can be writable!
10-
in_is_write = {pwd, "not-exists"};
10+
in_is_write = {pwd(), "not-exists"};
1111
ref_is_write = {true, false}
1212
p_expand
1313
p_same = {...
1414
{"","", false}, ...
1515
{tempname, tempname, false}, ...
1616
{"..", "./..", true}, ...
17-
{"..", pwd + "/..", true}}
17+
{"..", pwd() + "/..", true}}
1818
end
1919

2020
properties
@@ -28,7 +28,7 @@
2828
cwd = fileparts(mfilename("fullpath"));
2929
top = fullfile(cwd, "..");
3030
addpath(top)
31-
p_expand = {{"", ""}, {"~abc", "~abc"}, {"~", stdlib.homedir}, {"~/foo", stdlib.join(stdlib.homedir, "foo")}};
31+
p_expand = {{"", ""}, {"~abc", "~abc"}, {"~", stdlib.homedir()}, {"~/foo", stdlib.homedir() + "/foo"}};
3232
end
3333
end
3434

test/TestHDF5.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function setup_file(tc)
4141
tc.TestData.utf = utf;
4242
tc.TestData.utf2 = utf2;
4343

44-
tc.TestData.basic = stdlib.join(fixture.Folder, "basic.h5");
44+
tc.TestData.basic = stdlib.posix(fixture.Folder) + "/basic.h5";
4545
bf = tc.TestData.basic;
4646

4747
% create test data first, so that parallel tests works

test/TestHash.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ function test_extract(tc)
2929
tmpDir = fixture.Folder;
3030

3131
r = fileparts(mfilename('fullpath'));
32-
fn = stdlib.join(r, "hello.tar.zst");
32+
fn = stdlib.posix(r) + "/hello.tar.zst";
3333

3434
tc.assumeThat(fn, IsFile)
3535

3636
tc.assumeNotEmpty(stdlib.which("cmake"), "CMake not available")
3737

3838
stdlib.extract_zstd(fn, tmpDir)
39-
tc.verifyThat(stdlib.join(tmpDir, "test/hello.txt"), IsFile)
39+
tc.verifyThat(stdlib.posix(tmpDir) + "/test/hello.txt", IsFile)
4040

4141
end
4242

@@ -61,7 +61,7 @@ function test_hash_text(tc)
6161
import matlab.unittest.fixtures.TemporaryFolderFixture
6262
fixture = tc.applyFixture(TemporaryFolderFixture);
6363

64-
fn = stdlib.join(fixture.Folder, "hello");
64+
fn = stdlib.posix(fixture.Folder) + "/hello";
6565
fid = fopen(fn, "w");
6666
tc.assumeGreaterThan(fid, 0);
6767
fprintf(fid, "hello");

test/TestIni.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function test_example(tc)
1515
import matlab.unittest.constraints.IsFile
1616

1717
cwd = fileparts(mfilename('fullpath'));
18-
example = stdlib.join(cwd, "example.ini");
18+
example = stdlib.posix(cwd) + "/example.ini";
1919

2020
tc.assumeThat(example, IsFile)
2121

test/TestNetCDF.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function setup_file(tc)
3737
tc.TestData.utf1 = utf1;
3838
tc.TestData.utf2 = utf2;
3939

40-
basic = stdlib.join(fixture.Folder, "basic.nc");
40+
basic = stdlib.posix(fixture.Folder) + "/basic.nc";
4141
tc.TestData.basic = basic;
4242

4343
% create test data first, so that parallel tests works

test/TestResolve.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function test_resolve(tc)
9292
import matlab.unittest.constraints.EndsWithSubstring
9393
import matlab.unittest.constraints.ContainsSubstring
9494

95-
td = tc.applyFixture(TemporaryFolderFixture).Folder;
95+
td = stdlib.posix(tc.applyFixture(TemporaryFolderFixture).Folder);
9696
tc.applyFixture(CurrentFolderFixture(td))
9797

9898
% all non-existing files
@@ -130,8 +130,8 @@ function test_resolve(tc)
130130
tc.verifyEqual(stdlib.resolve("~/"), h)
131131
tc.verifyEqual(stdlib.resolve("~/.."), stdlib.parent(h))
132132

133-
tc.verifyEqual(stdlib.resolve("nobody.txt"), stdlib.join(td, "nobody.txt"))
134-
tc.verifyEqual(stdlib.resolve("../nobody.txt"), stdlib.join(stdlib.parent(td), "nobody.txt"))
133+
tc.verifyEqual(stdlib.resolve("nobody.txt"), td + "/nobody.txt")
134+
tc.verifyEqual(stdlib.resolve("../nobody.txt"), stdlib.parent(td) + "/nobody.txt")
135135

136136
end
137137

test/TestSymlink.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ function setup_symlink(tc)
1717
import matlab.unittest.fixtures.TemporaryFolderFixture
1818

1919
fixture = tc.applyFixture(TemporaryFolderFixture);
20-
td = fixture.Folder;
20+
td = stdlib.posix(fixture.Folder);
2121
tc.applyFixture(CurrentFolderFixture(td))
2222

23-
tc.TestData.link = stdlib.join(td, "my.lnk");
23+
tc.TestData.link = td + "/my.lnk";
2424

2525
tc.TestData.this = stdlib.posix(mfilename("fullpath") + ".m");
2626

test/TestWSL.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function test_is_exe_which_wsl(tc)
2626
tc.assumeNotEmpty(cc, "did not find WSL C compiler")
2727

2828
cwd = fileparts(mfilename('fullpath'));
29-
src = stdlib.winpath2wslpath(stdlib.join(cwd, "main.c"));
29+
src = stdlib.winpath2wslpath(stdlib.posix(cwd) + "/main.c");
3030

3131
[ret, out_wsl] = system("wsl mktemp -u");
3232
tc.assumeEqual(ret, 0, "could not get WSL tempfile")

0 commit comments

Comments
 (0)