summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-05-27 15:55:15 +0100
committerNicholas Clark <nick@ccl4.org>2011-07-01 13:24:33 +0200
commit7b2796fc4064d5a4210d5cc1dec9a2785c9d06f8 (patch)
tree2fd0531653c924cdc1bf1274836016894c60fc04
parent019c1b48d0afe02f6980be8f95bef63565035ccc (diff)
downloadperl-smoke-me/runperl.tar.gz
Convert B::Deparse's core.t to Test::More.smoke-me/runperl
Bring the joy of strict to it, remove the unused variable @bin, and convert a literal carriage return to a newline.
-rw-r--r--dist/B-Deparse/t/core.t21
1 files changed, 12 insertions, 9 deletions
diff --git a/dist/B-Deparse/t/core.t b/dist/B-Deparse/t/core.t
index 11eabc0f8b..b4e1a6e1af 100644
--- a/dist/B-Deparse/t/core.t
+++ b/dist/B-Deparse/t/core.t
@@ -1,11 +1,15 @@
#!./perl
BEGIN {
- unshift @INC, 't','../../t';
- require 'test.pl';
- skip_all_without_dynamic_extension('B');
+ require Config;
+ if (($Config::Config{extensions} !~ /\bB\b/) ){
+ print "1..0 # Skip -- Perl configured without B module\n";
+ exit 0;
+ }
}
+use strict;
+use Test::More;
# Many functions appear in multiple lists, so that shift() and shift(foo)
# are both tested.
@@ -55,10 +59,6 @@ my @nary = (
[qw( msgrcv open socketpair splice )]
);
-my $tests = @bin + 13;
-$tests += @$_ for @nary;
-plan $tests;
-
use B::Deparse;
my $deparse = new B::Deparse;
@@ -69,7 +69,7 @@ sub CORE_test {
import subs $keyword;
::like
$deparse->coderef2text(
- eval "sub { () = $expr }" or die "$@in $expr"
+ eval "no strict 'vars'; sub { () = $expr }" or die "$@in $expr"
),
qr/\sCORE::$keyword.*;/,
$name||$keyword
@@ -78,7 +78,8 @@ sub CORE_test {
for my $argc(0..$#nary) {
for(@{$nary[$argc]}) {
CORE_test
- $_, "CORE::$_(" . join(',',map "\$$_", (undef,"a".."z")[1..$argc]) . ")",
+ $_,
+ "CORE::$_(" . join(',',map "\$$_", (undef,"a".."z")[1..$argc]) . ")",
"$_, $argc argument" . "s"x($argc != 1);
}
}
@@ -103,3 +104,5 @@ CORE_test readpipe => 'CORE::readpipe $a+$b', 'readpipe';
# Tests for prefixing feature.pm-enabled keywords with CORE:: when
# feature.pm is not enabled are in deparse.t, as they fit that for-
# mat better.
+
+done_testing();