File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -159,19 +159,27 @@ function test_cpu_arch(tc, cpu_arch_fun)
159159end
160160
161161function test_ram_total(tc , ram_total_method )
162- is_capable(tc , str2func(" stdlib." + ram_total_method + " .ram_total" ))
163-
164- t = stdlib .ram_total(ram_total_method );
162+ try
163+ t = stdlib .ram_total(ram_total_method );
164+ catch e
165+ tc .verifyEqual(e .identifier , ' stdlib:choose_method:NameError' , e .message )
166+ return
167+ end
168+
165169tc .verifyGreaterThan(t , 0 )
166170tc .verifyClass(t , ' uint64' )
167171end
168172
169173
170174function test_ram_free(tc , ram_free_method )
171- % don't verify less than or equal total due to shaky system measurements
172- is_capable(tc , str2func(" stdlib." + ram_free_method + " .ram_free" ))
175+ % don't verify less than or equal total due to shaky system measurements'
176+ try
177+ f = stdlib .ram_free(ram_free_method );
178+ catch e
179+ tc .verifyEqual(e .identifier , ' stdlib:choose_method:NameError' , e .message )
180+ return
181+ end
173182
174- f = stdlib .ram_free(ram_free_method );
175183tc .verifyGreaterThan(f , 0 )
176184tc .verifyClass(f , ' uint64' )
177185end
Original file line number Diff line number Diff line change @@ -9,17 +9,12 @@ function is_capable(tc, f)
99if contains(n , " .dotnet." )
1010
1111 dapi = stdlib .dotnet_api();
12-
1312 tc .assumeGreaterThan(dapi , 0 , " .NET not available" )
1413
1514 if endsWith(n , [" is_admin" , " owner" ])
1615 tc .assumeTrue(ispc(), " Windows only function" )
1716 end
1817
19- if endsWith(n , " ram_total" )
20- tc .assumeGreaterThanOrEqual(dapi , 6 );
21- end
22-
2318elseif contains(n , " .java." )
2419
2520 japi = stdlib .java_api();
@@ -33,10 +28,6 @@ function is_capable(tc, f)
3328
3429 tc .assumeTrue(stdlib .has_python(), " Python not available" )
3530
36- if endsWith(n , [" filesystem_type" , " ram_free" , " ram_total" ])
37- tc .assumeTrue(stdlib .python .has_psutil(), " need Python psutil package" )
38- end
39-
4031 if endsWith(n , " owner" )
4132 tc .assumeFalse(ispc(), " unix only function" )
4233 end
You can’t perform that action at this time.
0 commit comments