From 52890a85ba877771240b70ddc6a5bbc395b51c99 Mon Sep 17 00:00:00 2001 From: Ed J Date: Wed, 27 Mar 2024 22:41:45 +0000 Subject: [PATCH] debug-print registration hash in test --- lib/PDL/Graphics/Simple/PGPLOT.pm | 7 ++++--- t/simple.t | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/PDL/Graphics/Simple/PGPLOT.pm b/lib/PDL/Graphics/Simple/PGPLOT.pm index a9eb6e9..93ca2eb 100644 --- a/lib/PDL/Graphics/Simple/PGPLOT.pm +++ b/lib/PDL/Graphics/Simple/PGPLOT.pm @@ -367,17 +367,16 @@ sub plot { } - sub DESTROY { my $me = shift; $me->{obj}->release; - if($me->{type} =~ m/^f/i) { + if (defined $me->{type} and $me->{type} =~ m/^f/i) { eval { $me->{obj}->close; }; my $file = ( ($me->{conv_fn}) ? $me->{conv_fn} : $me->{output} ); - if($me->{conv_fn}) { + if ($me->{conv_fn}) { my $a; $a = rim($me->{conv_fn}) ; wim($a, $me->{opt}->{output}); @@ -385,3 +384,5 @@ sub DESTROY { } } } + +1; diff --git a/t/simple.t b/t/simple.t index 8c55052..6f4093f 100644 --- a/t/simple.t +++ b/t/simple.t @@ -48,9 +48,10 @@ for my $engine (@engines) { ok( ( ref($mods->{$engine}) eq 'HASH' and ($module = $mods->{$engine}->{module}) ), "there is a modules entry for $engine ($module)" ); - SKIP: { + SKIP: { my $check_ok = eval {${module}->can('check')->(1)}; is($@, '', "${module}::check() ran OK"); + diag "module '$engine' registration hash: ", explain $mods->{$engine}; unless($check_ok) { no strict 'refs';