@@ -3,10 +3,10 @@ use warnings;
33use Test::More;
44use PDL::LiteF;
55use Benchmark qw( timethese :hireswallclock) ;
6+ use Test::PDL -atol => 0.01; # set eps
67
78plan skip_all => ' No threads' if !PDL::Core::pthreads_enabled;
89
9- approx( pdl(0), pdl(0), 0.01); # set eps
1010set_autopthread_size(0);
1111
1212for (
@@ -64,7 +64,7 @@ for (@T) {
6464
6565 $thr_check -> ();
6666
67- ok all(approx $pa ,$pb ) , " pa and pb match $label " or diag " diff at: " , ( $pa != $pb ) -> whichND. " " ;
67+ is_pdl $pa ,$pb , " pa and pb match $label " ;
6868 }
6969
7070 {
@@ -74,7 +74,7 @@ for (@T) {
7474 my $pc = inner $pa , $pb ;
7575 $thr_off -> ($pa );
7676 my $cc = $pa -> sumover;
77- ok all(approx( $pc ,$cc )) , " inner $label " or diag " pc= $pc \n cc= $cc " ;
77+ is_pdl $pc , $cc , " inner $label " ;
7878 }
7979
8080 {
@@ -85,7 +85,7 @@ for (@T) {
8585 $pa +=1;
8686 $thr_off -> ($pb );
8787 $pb +=1;
88- ok all(approx $pa , $pb ) , " += $label " ;
88+ is_pdl $pa , $pb , " += $label " ;
8989 }
9090
9191 # ## Multi-dimensional incrementing case ###
@@ -122,11 +122,11 @@ for (@T) {
122122
123123 # Check for writeback to the parent PDL working (should have three ones in the array)
124124 my $lutExSum = $lutEx -> sum;
125- ok all(approx( $lutExSum , pdl(3)) ), " writeback $label " ;
125+ is_pdl $lutExSum , pdl(3), " writeback $label " ;
126126
127127 # Check for inplace assignment working. $in should be all ones
128128 my $inSum = $in -> sum;
129- ok all(approx( $inSum , pdl(2) ) ), " inplace $label " ;
129+ is_pdl $inSum , pdl(2), " inplace $label " ;
130130 }
131131
132132 {
@@ -158,11 +158,11 @@ for (@T) {
158158
159159 # Check for writeback to the parent PDL working (should have three ones in the array)
160160 my $lutExSum = $lutEx -> sum;
161- ok all(approx( $lutExSum , pdl(5)) ), " writeback with different magic $label " ;
161+ is_pdl $lutExSum , pdl(5), " writeback with different magic $label " ;
162162
163163 # Check for inplace assignment working. $in should be all ones
164164 my $inSum = $in -> sum;
165- ok all(approx( $inSum , pdl(2)) ), " inplace with different magic $label " ;
165+ is_pdl $inSum , pdl(2), " inplace with different magic $label " ;
166166 }
167167}
168168
0 commit comments