Skip to content
Browse files

Sync with Bullwinkle. Add test for recent bug found.

  • Loading branch information...
1 parent f3a12f4 commit d6bc37269f9433c28016e55b46fa54855676cd9f Rocky Bernstein committed
Showing with 60 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +29 −0 t/10test-location.t
  3. +14 −0 t/data/fin3.cmd
  4. +15 −0 t/data/fin3.right
View
2 .gitignore
@@ -9,4 +9,6 @@
/Makefile.PL
/_build
/blib
+/pod2htmd.tmp
+/pod2htmi.tmp
/tmp
View
29 t/10test-location.t
@@ -0,0 +1,29 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use rlib '../lib';
+use Test::More;
+
+BEGIN {
+use_ok( 'Devel::Trepan::CmdProcessor::Location' );
+use_ok( 'Devel::Trepan::CmdProcessor' );
+}
+
+my $proc = Devel::Trepan::CmdProcessor->new;
+
+sub create_frame() {
+ my ($pkg, $file, $line, $fn) = caller(0);
+ return [
+ {
+ file => $file,
+ fn => $fn,
+ line => $line,
+ pkg => $pkg,
+ }];
+}
+
+my $frame_ary = create_frame();
+$proc->frame_setup($frame_ary);
+my $x = $proc->current_source_text({output=>'plain'});
+is('my $frame_ary = create_frame();', $x);
+done_testing();
View
14 t/data/fin3.cmd
@@ -0,0 +1,14 @@
+# See that finish on a breakpoint line reports a "return" event
+# not a breakpoint event. Line 21 the return location of gcd.
+b 21
+next 1
+next 1
+step
+fin
+info return
+quit!
+
+
+
+
+
View
15 t/data/fin3.right
@@ -0,0 +1,15 @@
+-- main::(gcd.pl:18)
+die sprintf "Need two integer arguments, got %d", scalar(@ARGV) unless
+ @ARGV == 2;
+Breakpoint 1 set in gcd.pl at line 21
+-- main::(gcd.pl:20)
+my ($a, $b) = @ARGV[0,1];
+xx main::(gcd.pl:21)
+printf "The GCD of %d and %d is %d\n", $a, $b, gcd($a, $b);
+-- main::(gcd.pl:9)
+ my ($a, $b) = @_;
+<- main::(gcd.pl:21) main::gcd
+printf "The GCD of %d and %d is %d\n", $a, $b, gcd($a, $b);
+Return array value for main::gcd is:
+1
+

0 comments on commit d6bc372

Please sign in to comment.
Something went wrong with that request. Please try again.