File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,15 @@ sub fapprox {
1414sub runtest {
1515 local $Test::Builder::Level = $Test::Builder::Level + 1;
1616 my ($in , $method , $expected , $extra ) = @_ ;
17+ $_ = $_ -> copy for $in ;
1718 ($expected , my $expected_cplx ) = ref ($expected ) eq ' ARRAY' ? @$expected : ($expected , $expected );
19+ my @extra = map UNIVERSAL::isa($_ , ' PDL' ) ? $_ -> copy : $_ , @{$extra ||[]};
1820 if (defined $expected ) {
19- my ($got ) = $in -> $method (@{ $ extra||[]} );
21+ my ($got ) = $in -> $method (@extra );
2022 ok fapprox($got , $expected ), $method or diag " got(" .ref ($got )." ): $got \n expected:$expected " ;
2123 }
22- $_ = PDL -> topdl( $_ ) -> r2C for $in ;
23- my ($got ) = $in -> $method (map ref () && ref () ne ' CODE' ? $_ -> r2C : $_ , @{ $ extra||[]} );
24+ $_ = $_ -> r2C for $in ;
25+ my ($got ) = $in -> $method (map ref () && ref () ne ' CODE' ? $_ -> r2C : $_ , @extra );
2426 my @cplx = ref ($expected_cplx ) eq ' ARRAY' ? @$expected_cplx : $expected_cplx ;
2527 my $ok = grep fapprox($got , PDL-> topdl($_ )-> r2C), @cplx ;
2628 ok $ok , " native complex $method " or diag " got(" .ref ($got )." ): $got \n expected:@cplx " ;
You can’t perform that action at this time.
0 commit comments