This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix eval.t under minitest, inadvertently broken by 0d804ff61f3a2df2
authorNicholas Clark <nick@ccl4.org>
Tue, 12 Apr 2011 14:00:51 +0000 (15:00 +0100)
committerNicholas Clark <nick@ccl4.org>
Tue, 12 Apr 2011 14:00:51 +0000 (15:00 +0100)
That change attempted to skip if use Devel::Peek failed with a skip message of
of $@. Unfortunately, in this situation, $@ has multiple lines, which is not
valid as a skip message. So instead skip if we're miniperl, or we haven't built
Devel::Peek, otherwise attempt to run the test.

t/op/eval.t

index 526ea4c..fbe939c 100644 (file)
@@ -465,8 +465,10 @@ cmp_ok(length $@, '==', 0, 'length of $@ after eval');
 
 # Check if eval { 1 }; completely resets $@
 SKIP: {
-    skip("Can't load Devel::Peek: $@", 2)
-       unless eval "use Devel::Peek; 1;";
+    skip_if_miniperl('no dynamic loading on miniperl, no Devel::Peek', 2);
+    require Config;
+    skip('Devel::Peek was not built', 2)
+       unless $Config::Config{extensions} =~ /\bDevel\/Peek\b/;
 
     my $tempfile = tempfile();
     open $prog, ">", $tempfile or die "Can't create test file";