1- classdef (SharedTestFixtures = { matlab .unittest .fixtures .PathFixture(fileparts(fileparts(mfilename(' fullpath' ))))}, ...
2- TestTags = {' impure' }) ...
1+ classdef (SharedTestFixtures = { matlab .unittest .fixtures .PathFixture(fileparts(fileparts(mfilename(' fullpath' ))))}) ...
32 TestExists < matlab .unittest .TestCase
43
54properties (TestParameter )
@@ -18,19 +17,28 @@ function test_dirs(tc)
1817methods (Test , TestTags = {' R2018a' })
1918
2019function test_exists(tc , Ps )
21- ok = stdlib .exists(Ps{1 });
22- tc .verifyEqual(ok , Ps{2 }, Ps{1 })
20+ r = stdlib .exists(Ps{1 });
21+ tc .verifyEqual(r , Ps{2 }, Ps{1 })
22+
23+ r = stdlib .exists(string(Ps{1 }));
24+ tc .verifyEqual(r , Ps{2 })
2325end
2426
2527
2628function test_is_readable(tc , Ps )
2729r = stdlib .is_readable(Ps{1 });
2830tc .verifyEqual(r , Ps{2 })
31+
32+ r = stdlib .is_readable(string(Ps{1 }));
33+ tc .verifyEqual(r , Ps{2 });
2934end
3035
3136function test_is_writable(tc , Ps )
3237r = stdlib .is_writable(Ps{1 });
3338tc .verifyEqual(r , Ps{2 })
39+
40+ r = stdlib .is_writable(string(Ps{1 }));
41+ tc .verifyEqual(r , Ps{2 });
3442end
3543end
3644
@@ -46,6 +54,8 @@ function test_is_char_device(tc, B_is_char_device)
4654
4755if ismember(B_is_char_device , stdlib .Backend().select(' is_char_device' ))
4856 tc .verifyTrue(r , n )
57+
58+ tc .verifyTrue(stdlib .is_char_device(string(n ), B_is_char_device ))
4959else
5060 tc .verifyEmpty(r )
5161end
@@ -58,11 +68,10 @@ function test_is_char_device(tc, B_is_char_device)
5868function Ps = init_val()
5969Ps = {
6070 {pwd(), true }, ...
61- {mfilename(" fullpath" ) + " .m " , true }, ...
62- {fileparts(mfilename(" fullpath" )) + " /../Readme.md" , true }, ...
71+ {[ mfilename(" fullpath" ), ' .m ' ] , true }, ...
72+ {[ fileparts(mfilename(" fullpath" )), ' /../Readme.md' ] , true }, ...
6373 {tempname(), false }, ...
64- {' ' , false }, ...
65- {" " , false }
74+ {' ' , false }
6675};
6776if ispc()
6877 % On Windows, the root of the system drive is considered to exist
0 commit comments