Skip to content

Commit 4a5bda3

Browse files
committed
put error-check tests first to avoid skip_all giving "UNKNOWN" results
1 parent 8229333 commit 4a5bda3

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

Changes

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- adjust tests to avoid spurious "UNKNOWN" results
2+
13
1.012 2024-09-21
24
- add "contours", "fits", "polylines" plot types
35

t/simple.t

+14-10
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@ sub ask_yn {
1919
unlike($a, qr/n/i, $label);
2020
}
2121

22-
# first so no "bad plan" if skip_all
23-
{
24-
my @new = eval {PDL::Graphics::Simple::_translate_new()};
25-
diag(join '',explain $PDL::Graphics::Simple::mods), plan skip_all => 'No plotting engines installed' if $@ =~ /Sorry, all known/;
26-
# ignore $engine
27-
is_deeply $new[1], {
28-
'multi' => undef, 'output' => '', 'size' => [ 8, 6, 'in' ], 'type' => 'i'
29-
} or diag explain \@new;
30-
}
31-
3222
# error handling
3323
eval {
3424
PDL::Graphics::Simple::_translate_plot(undef, undef, with=>'line', undef);
@@ -66,6 +56,20 @@ like $@, qr/Single-arg/;
6656
is "@w", "", "no warnings";
6757
}
6858

59+
{
60+
my @new = eval {PDL::Graphics::Simple::_translate_new()};
61+
if ($@ =~ /Sorry, all known/) {
62+
diag(join '',explain $PDL::Graphics::Simple::mods);
63+
ok 1, 'No plotting engines installed, stopping';
64+
done_testing;
65+
exit 0;
66+
}
67+
# ignore $engine
68+
is_deeply $new[1], {
69+
'multi' => undef, 'output' => '', 'size' => [ 8, 6, 'in' ], 'type' => 'i'
70+
} or diag explain \@new;
71+
}
72+
6973
##############################
7074
# Try the simple engine and convenience interfaces...
7175

0 commit comments

Comments
 (0)