11classdef TestFileImpure < matlab .unittest .TestCase
22
33properties (TestParameter )
4- p_same = {...
5- {" .." , " ./.." }, ...
6- {" .." , pwd() + " /.." }, ...
7- {pwd(), pwd() + " /." }}
8-
94ph = {{0 , ' "stdin"' }, {1 , ' "stdout"' }, {2 , ' "stderr"' }, {fopen(tempname()), ' ' }}
105
116p_file_size = {mfilename(" fullpath" ) + " .m" }
127end
138
149
10+ methods (TestClassSetup )
11+ function pkg_path(tc )
12+ p = matlab .unittest .fixtures .PathFixture(fileparts(fileparts(mfilename(' fullpath' ))));
13+ tc .applyFixture(p )
14+ end
15+ end
16+
17+
1518methods (Test , TestTags = " impure" )
1619
1720function test_file_size(tc , p_file_size )
@@ -31,28 +34,10 @@ function test_makedir(tc)
3134import matlab .unittest .constraints .IsFolder
3235d = tempname();
3336stdlib .makedir(d )
34- tc .assertThat (d , IsFolder )
37+ tc .verifyThat (d , IsFolder )
3538rmdir(d )
3639end
3740
38- %%
39- function test_samepath(tc , p_same )
40- tc .verifyTrue(stdlib .samepath(p_same{1 }, p_same{2 }))
41- end
42-
43- function test_samepath_notexist(tc )
44- tc .verifyFalse(stdlib .samepath(" " , " " ))
45- t = tempname();
46- tc .verifyFalse(stdlib .samepath(t , t ))
47- end
48-
49-
50- function test_get_pid(tc )
51- pid = stdlib .get_pid();
52- tc .verifyGreaterThan(pid , 0 )
53- tc .verifyClass(pid , ' uint64' )
54- end
55-
5641
5742function test_handle2filename(tc , ph )
5843tc .verifyEqual(stdlib .handle2filename(ph{1 }), ph{2 })
0 commit comments