From: Rafael Garcia-Suarez Date: Wed, 12 Jul 2006 13:19:04 +0000 (+0000) Subject: Cleanup and conversion to t/test.pl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e7ecf62cedd0a2f997ee793f65cc0d739269e707;p=p5sagit%2Fp5-mst-13.2.git Cleanup and conversion to t/test.pl p4raw-id: //depot/perl@28559 --- diff --git a/ext/Devel/Peek/t/Peek.t b/ext/Devel/Peek/t/Peek.t index f40bc5e..099e165 100644 --- a/ext/Devel/Peek/t/Peek.t +++ b/ext/Devel/Peek/t/Peek.t @@ -4,20 +4,21 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require Config; import Config; - if ($Config{'extensions'} !~ /\bPeek\b/) { + if ($Config{'extensions'} !~ /\bDevel\/Peek\b/) { print "1..0 # Skip: Devel::Peek was not built\n"; exit 0; } } +require "./test.pl"; + use Devel::Peek; -print "1..23\n"; +plan(23); our $DEBUG = 0; open(SAVERR, ">&STDERR") or die "Can't dup STDERR: $!"; - sub do_test { my $pattern = pop; if (open(OUT,">peek$$")) { @@ -42,14 +43,10 @@ sub do_test { ($] < 5.009) ? " IV = 0\n NV = 0\n" : ''; /mge; - - print $pattern, "\n" if $DEBUG; my $dump = ; print $dump, "\n" if $DEBUG; - print "got:\n[\n$dump\n]\nexpected:\n[\n$pattern\n]\nnot " - unless $dump =~ /\A$pattern\Z/ms; - print "ok $_[0]\n"; + like( $dump, qr/\A$pattern\Z/ms ); close(IN); return $1; } else { @@ -65,6 +62,9 @@ our $b; my $c; local $d = 0; +END { + 1 while unlink("peek$$"); +} do_test( 1, $a = "foo", @@ -446,10 +446,6 @@ do_test(21, MG_VIRTUAL = &PL_vtbl_taint MG_TYPE = PERL_MAGIC_taint\\(t\\)'); -END { - 1 while unlink("peek$$"); -} - # blessed refs do_test(22, bless(\\undef, 'Foobar'),