From 89d5b51d5d21db1c45629e5da40b783132064c9e Mon Sep 17 00:00:00 2001 From: Luis Mochan Date: Wed, 15 Jan 2025 11:44:38 -0600 Subject: [PATCH] Add tests of r2C --- t/ops.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/t/ops.t b/t/ops.t index b4d80de3f..b22db2afc 100644 --- a/t/ops.t +++ b/t/ops.t @@ -5,6 +5,7 @@ use PDL::LiteF; use Config; kill 'INT',$$ if $ENV{UNDER_DEBUGGER}; # Useful for debugging. use Test::Exception; +use Test::PDL; require PDL::Core::Dev; kill 'INT',$$ if $ENV{UNDER_DEBUGGER}; # Useful for debugging. @@ -111,6 +112,17 @@ if ($can_complex_power) { is $pa->at(0), '16', 'sqrt orig value ok'; } +{ + is_pdl(r2C(long(1)), cdouble(1), "r2C of long"); + is_pdl(r2C(longlong(1)), cdouble(1), "r2C of longlong"); + is_pdl(r2C(float(1)), cfloat(1), "r2C of float"); + is_pdl(r2C(double(1)), cdouble(1), "r2C of double"); + is_pdl(r2C(ldouble(1)), cldouble(1), "r2C of ldouble"); + is_pdl(r2C(cfloat(1)), cfloat(1), "r2C of cfloat"); + is_pdl(r2C(cdouble(1)), cdouble(1), "r2C of cdouble"); + is_pdl(r2C(cldouble(1)), cldouble(1), "r2C of cldouble"); +} + { my $pa = pdl 1,0; my $pb = ! $pa;