summaryrefslogtreecommitdiff
path: root/lib/perl5db
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-09-08 06:46:00 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-09-08 06:46:00 +0000
commit7a2852eada400bfff9c63c487d3e65594d12d98f (patch)
treef148e955c8aaf2f73cd5434bfc1c6a28fb5e1fa0 /lib/perl5db
parentf97a9a4b11bc5c17f0a5caadd0d46e4be5b95cba (diff)
downloadperl-7a2852eada400bfff9c63c487d3e65594d12d98f.tar.gz
de0.t: use Test::More, add some tests.
p4raw-id: //depot/perl@21071
Diffstat (limited to 'lib/perl5db')
-rw-r--r--lib/perl5db/de0.t37
1 files changed, 23 insertions, 14 deletions
diff --git a/lib/perl5db/de0.t b/lib/perl5db/de0.t
index b5a416ffef..20bd0778e2 100644
--- a/lib/perl5db/de0.t
+++ b/lib/perl5db/de0.t
@@ -13,17 +13,25 @@ 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";
our $tmpfile = "perl5db0";
1 while -f ++$tmpfile;
END { if ($tmpfile) { 1 while unlink $tmpfile; } }
-my $i = 0;
$ENV{PERLDB_OPTS} = "TTY=0";
my($ornament1,$ornament2);
for (@prgs){
@@ -39,14 +47,7 @@ for (@prgs){
}
$got =~ s/^\Q$ornament1\E//;
$got =~ s/\Q$ornament2\E\z//;
- my $not = "";
- my $why = "";
- if ($got !~ /$expected/) {
- $not = "not ";
- $got = dumpvar::unctrl($got);
- $why = " # prog[$prog]got[$got]expected[$expected]";
- }
- print $not, "ok ", ++$i, $why, "\n";
+ like($got, qr:$expected:i, $prog);
}
__END__
@@ -58,6 +59,14 @@ x "foo"
EXPECT
0 'foo'
########
+x "\x{100}"
+EXPECT
+0 '\\x\{0100\}'
+########
+x *a
+EXPECT
+0 \*main::a
+########
x 1..3
EXPECT
0 1
@@ -66,7 +75,7 @@ EXPECT
########
x +{1..4}
EXPECT
-0\s+HASH\(0x[\da-f]+\)
+0\s+HASH\(0x[0-9a-f]+\)
\s+1 => 2
\s+3 => 4
########