summaryrefslogtreecommitdiff
path: root/lib/perl5db
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-09-08 05:21:21 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-09-08 05:21:21 +0000
commit96b31d9ef6f02d5fac0d5502d45bc0ba71d292d8 (patch)
tree8905c42f5dbdcb365a0aa9004fd9254fcdf8a153 /lib/perl5db
parenta920b0f7adaa661c0a5c180b356e27434c29449f (diff)
downloadperl-96b31d9ef6f02d5fac0d5502d45bc0ba71d292d8.tar.gz
dumpvar.t: use Test::More;
p4raw-id: //depot/perl@21068
Diffstat (limited to 'lib/perl5db')
-rw-r--r--lib/perl5db/dumpvar.t39
1 files changed, 20 insertions, 19 deletions
diff --git a/lib/perl5db/dumpvar.t b/lib/perl5db/dumpvar.t
index 4530c3b0e1..08dfe22df1 100644
--- a/lib/perl5db/dumpvar.t
+++ b/lib/perl5db/dumpvar.t
@@ -12,35 +12,36 @@ BEGIN {
use strict;
$|=1;
-undef $/;
-my @prgs = split "########\n", <DATA>;
-close DATA;
-print "1..", scalar @prgs, "\n";
+
+my @prgs;
+{
+ local $/;
+ @prgs = split "########\n", <DATA>;
+ close DATA;
+}
+
+use Test::More;
+
+plan tests => scalar @prgs;
+
require "dumpvar.pl";
-my $i = 0;
-for (@prgs){
- my($prog,$expected) = split(/\nEXPECT\n?/, $_);
+for (@prgs) {
+ my($prog, $expected) = split(/\nEXPECT\n?/, $_);
open my $select, ">", \my $got or die;
select $select;
eval $prog;
- my $not = "";
- my $why = "";
- if ($@) {
- $not = "not ";
- $why = " # prog[$prog]\$\@[$@]";
- } elsif ($got ne $expected) {
- $not = "not ";
- $why = " # prog[$prog]got[$got]expected[$expected]";
- }
+ my $ERR = $@;
close $select;
select STDOUT;
- print $not, "ok ", ++$i, $why, "\n";
+ if ($ERR) {
+ ok(0, "$prog - $ERR");
+ } else {
+ is($got, $expected, $prog);
+ }
}
__END__
-"";
-EXPECT
########
dumpValue(1);
EXPECT