1010{" " , false }
1111}
1212% on CI matlabroot can be writable!
13- isr_method = {' java ' , ' native ' , ' legacy ' }
14- isw_method = {' java' , ' native' , ' legacy' }
13+ fname = {' is_readable ' , ' is_writable ' }
14+ method = {' java' , ' native' , ' legacy' }
1515end
1616
1717methods (TestClassSetup )
@@ -29,31 +29,16 @@ function test_exists(tc, Ps)
2929end
3030
3131
32- function test_is_readable(tc , Ps , isr_method )
33- is_capable(tc , str2func(" stdlib." + isr_method + " .is_readable" ))
34-
35- ok = stdlib .is_readable(Ps{1 }, isr_method );
36- tc .verifyEqual(ok , Ps{2 }, Ps{1 })
37- end
38-
39-
40- function test_is_writable(tc , Ps , isw_method )
41- is_capable(tc , str2func(" stdlib." + isw_method + " .is_writable" ))
42-
43- ok = stdlib .is_writable(Ps{1 }, isw_method );
44- tc .verifyEqual(ok , Ps{2 }, Ps{1 })
32+ function test_is_rw(tc , Ps , method , fname )
33+ n = " stdlib." + method + " ." + fname ;
34+ h = str2func(" stdlib." + fname );
35+ tc .assertNotEmpty(which(n ))
36+ try
37+ tc .verifyEqual(h(Ps{1 }, method ), Ps{2 })
38+ catch e
39+ tc .verifyEqual(e .identifier , ' stdlib:choose_method:NameError' )
4540end
46-
47- function test_is_writable_dir(tc , isw_method )
48- is_capable(tc , str2func(" stdlib." + isw_method + " .is_writable" ))
49-
50- tc .assumeFalse(isMATLABReleaseOlderThan(' R2022a' ))
51-
52- td = tc .createTemporaryFolder();
53-
54- tc .verifyTrue(stdlib .is_writable(td , isw_method ))
5541end
5642
5743end
58-
5944end
0 commit comments