summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2011-12-11 21:49:29 +0200
committerRicardo Signes <rjbs@cpan.org>2011-12-30 11:54:46 -0500
commit5bc17875001e1a4da4263a1f5cba8f517c77984a (patch)
tree8d62ad499799c458824c93acdc8fe313a3dd7c3f /lib
parent9f810cd7bc6d908e8a5c28b2f8fecc244247e97f (diff)
downloadperl-5bc17875001e1a4da4263a1f5cba8f517c77984a.tar.gz
perl -d: test for 'T'.
Diffstat (limited to 'lib')
-rw-r--r--lib/perl5db.t40
1 files changed, 39 insertions, 1 deletions
diff --git a/lib/perl5db.t b/lib/perl5db.t
index d08323a3d1..280f04032a 100644
--- a/lib/perl5db.t
+++ b/lib/perl5db.t
@@ -28,7 +28,7 @@ BEGIN {
}
}
-plan(24);
+plan(25);
my $rc_filename = '.perldb';
@@ -546,6 +546,44 @@ EOF
);
}
+# Tests for "T" (stack trace).
+{
+ rc(<<'EOF');
+&parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
+
+sub afterinit {
+ push (@DB::typeahead,
+ 'c baz',
+ 'T',
+ 'q',
+ );
+
+}
+EOF
+
+ my $prog_fn = '../lib/perl5db/t/rt-104168';
+ my $output = runperl(switches => [ '-d', ], stderr => 1, progfile => $prog_fn,);
+
+ my $re_text = join('',
+ map {
+ sprintf(
+ "%s = %s\\(\\) called from file " .
+ "'" . quotemeta($prog_fn) . "' line %s\\n",
+ (map { quotemeta($_) } @$_)
+ )
+ }
+ (
+ ['.', 'main::baz', 14,],
+ ['.', 'main::bar', 9,],
+ ['.', 'main::foo', 6]
+ )
+ );
+ like(_out_contents(),
+ # qr/^0\s+HASH\([^\)]+\)\n\s+500 => 600\n/,
+ qr/^$re_text/ms,
+ "T command test."
+ );
+}
END {
1 while unlink ($rc_filename, $out_fn);
}