88fun = {@stdlib.isoctave, @stdlib.has_dotnet, ...
99 @stdlib.has_java , @stdlib.has_python }
1010cpu_arch_fun = {' java' , ' dotnet' , ' native' }
11- ia_fun = {' sys' , ' dotnet' , ' java' , ' python' }
1211cr_method = {' sys' , ' java' , ' python' }
13- os_m = {' java' , ' python' , ' dotnet' , ' sys' }
12+ all_fun = {' java' , ' python' , ' dotnet' , ' sys' }
1413end
1514
1615methods (TestClassSetup )
@@ -35,10 +34,10 @@ function test_is_cygwin(tc)
3534tc .verifyFalse(stdlib .is_cygwin())
3635end
3736
38- function test_is_admin(tc , ia_fun )
39- tc .assertNotEmpty(which(" stdlib." + ia_fun + " .is_admin" ))
37+ function test_is_admin(tc , all_fun )
38+ tc .assertNotEmpty(which(" stdlib." + all_fun + " .is_admin" ))
4039try
41- i = stdlib .is_admin(ia_fun );
40+ i = stdlib .is_admin(all_fun );
4241 tc .verifyClass(i , " logical" )
4342 tc .verifyNotEmpty(i )
4443catch e
@@ -109,9 +108,9 @@ function test_has_python(tc)
109108tc .verifyTrue(all(v >= [3 , 8 , 0 ]), " expected Python >= 3.8" )
110109end
111110
112- function test_os_version(tc , os_m )
111+ function test_os_version(tc , all_fun )
113112try
114- [os , ver ] = stdlib .os_version(os_m );
113+ [os , ver ] = stdlib .os_version(all_fun );
115114catch e
116115 tc .verifyEqual(e .identifier , ' stdlib:hbackend:NameError' , e .message )
117116 return
@@ -135,24 +134,27 @@ function test_is_parallel(tc)
135134tc .verifyClass(ip , ' logical' )
136135end
137136
138- function test_hostname(tc , ia_fun )
139- tc .assertNotEmpty(which(" stdlib." + ia_fun + " .get_hostname" ))
137+ function test_hostname(tc , all_fun )
138+ tc .assertNotEmpty(which(" stdlib." + all_fun + " .get_hostname" ))
140139try
141- h = stdlib .hostname(ia_fun );
140+ h = stdlib .hostname(all_fun );
142141 tc .verifyGreaterThan(strlength(h ), 0 )
143142catch e
144143 tc .verifyEqual(e .identifier , ' stdlib:hbackend:NameError' , e .message )
145144end
146145end
147146
148- function test_username(tc , ia_fun )
149- tc .assertNotEmpty(which(" stdlib." + ia_fun + " .get_username" ))
147+ function test_username(tc , all_fun )
148+ tc .assertNotEmpty(which(" stdlib." + all_fun + " .get_username" ))
150149try
151- u = stdlib .get_username(ia_fun );
152- tc .verifyGreaterThan(strlength(u ), 0 )
150+ u = stdlib .get_username(all_fun );
153151catch e
154152 tc .verifyEqual(e .identifier , ' stdlib:hbackend:NameError' , e .message )
153+ return
155154end
155+
156+ tc .verifyClass(u , ' char' )
157+ tc .verifyGreaterThan(strlength(u ), 0 )
156158end
157159
158160
@@ -176,9 +178,9 @@ function test_cpu_arch(tc, cpu_arch_fun)
176178tc .verifyGreaterThan(strlength(arch ), 0 , " CPU architecture should not be empty" )
177179end
178180
179- function test_ram_total(tc , ia_fun )
181+ function test_ram_total(tc , all_fun )
180182try
181- t = stdlib .ram_total(ia_fun );
183+ t = stdlib .ram_total(all_fun );
182184catch e
183185 tc .verifyEqual(e .identifier , ' stdlib:hbackend:NameError' , e .message )
184186 return
0 commit comments