From 4a5bda3fb2e9fc4524f1547d4ad302847710d63a Mon Sep 17 00:00:00 2001 From: Ed J Date: Tue, 24 Sep 2024 13:54:01 +0000 Subject: [PATCH] put error-check tests first to avoid skip_all giving "UNKNOWN" results --- Changes | 2 ++ t/simple.t | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index a6b20a1..9a1f5ea 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +- adjust tests to avoid spurious "UNKNOWN" results + 1.012 2024-09-21 - add "contours", "fits", "polylines" plot types diff --git a/t/simple.t b/t/simple.t index a8415a8..f7b29ed 100644 --- a/t/simple.t +++ b/t/simple.t @@ -19,16 +19,6 @@ sub ask_yn { unlike($a, qr/n/i, $label); } -# first so no "bad plan" if skip_all -{ -my @new = eval {PDL::Graphics::Simple::_translate_new()}; -diag(join '',explain $PDL::Graphics::Simple::mods), plan skip_all => 'No plotting engines installed' if $@ =~ /Sorry, all known/; -# ignore $engine -is_deeply $new[1], { - 'multi' => undef, 'output' => '', 'size' => [ 8, 6, 'in' ], 'type' => 'i' -} or diag explain \@new; -} - # error handling eval { PDL::Graphics::Simple::_translate_plot(undef, undef, with=>'line', undef); @@ -66,6 +56,20 @@ like $@, qr/Single-arg/; is "@w", "", "no warnings"; } +{ +my @new = eval {PDL::Graphics::Simple::_translate_new()}; +if ($@ =~ /Sorry, all known/) { + diag(join '',explain $PDL::Graphics::Simple::mods); + ok 1, 'No plotting engines installed, stopping'; + done_testing; + exit 0; +} +# ignore $engine +is_deeply $new[1], { + 'multi' => undef, 'output' => '', 'size' => [ 8, 6, 'in' ], 'type' => 'i' +} or diag explain \@new; +} + ############################## # Try the simple engine and convenience interfaces...