Permalink
Browse files

DB.pm: One more place to convert DB::eval. Add action test. Skip tcpi…

…p socket test on Strawberry Perl.
  • Loading branch information...
Rocky Bernstein
Rocky Bernstein committed Oct 3, 2012
1 parent 31570ee commit aa0f6d916d2cf06c5200610a0535667435c83b0e
Showing with 57 additions and 5 deletions.
  1. +3 −0 MANIFEST
  2. +1 −1 lib/Devel/Trepan.pm
  3. +2 −1 lib/Devel/Trepan/DB.pm
  4. +1 −1 t/10test-condition.t
  5. +8 −2 t/10test-io-tcpserver.t
  6. +9 −0 t/20test-action.t
  7. +7 −0 t/data/action.cmd
  8. +26 −0 t/data/action.right
View
@@ -231,6 +231,7 @@ t/20test-display.t
t/20test-eval.t
t/20test-fin.t
t/20test-__FILE__.t
+t/20test-action.t
t/20test-line.t
t/20test-list1.t
t/20test-list2.t
@@ -248,6 +249,8 @@ t/20test-trepanpl-opts.t
t/20test-watch1.t
t/data/__FILE__.cmd
t/data/__FILE__.right
+t/data/action.cmd
+t/data/action.right
t/data/alias.cmd
t/data/alias.right
t/data/autolist.cmd
View
@@ -18,7 +18,7 @@ use Exporter;
use constant PROGRAM => 'trepan.pl';
use version;
-$VERSION='0.45'; # To fool CPAN indexer. Is <= real version
+$VERSION='0.45_01'; # To fool CPAN indexer. Is <= real version
$VERSION = $Devel::Trepan::Version::VERSION;
sub show_version() {
View
@@ -295,7 +295,8 @@ sub DB {
}
for my $action (@action) {
- &DB::eval($namespace_package, $action->condition, @saved)
+ &DB::eval_with_return($action->condition, {return_type => '$'},
+ @saved)
if $action->enabled;
my $hits = $action->hits + 1;
$action->hits($hits);
View
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
use strict; use warnings;
-use English;
+use English qw( -no_match_vars );
use rlib '../lib';
use Devel::Trepan::Condition;
View
@@ -1,9 +1,15 @@
#!/usr/bin/env perl
-use strict;
-use warnings;
+use strict; use warnings;
+use English qw( -no_match_vars );
use rlib '../lib';
use Test::More;
+if ($OSNAME eq 'MSWin32') {
+ plan skip_all => "FIXME see if we can make this work on Strawberry Perl"
+} else {
+ plan;
+}
+
note( "Testing Devel::IO::TCPServer" );
BEGIN {
View
@@ -0,0 +1,9 @@
+#!/usr/bin/env perl
+use warnings; use strict;
+use Test::More;
+use rlib '.';
+use Helper;
+my $test_prog = File::Spec->catfile(dirname(__FILE__),
+ qw(.. example action-bug.pl));
+Helper::run_debugger("$test_prog", 'action.cmd');
+done_testing();
View
@@ -0,0 +1,7 @@
+# Use with example/gcd.pl
+set basename on
+set highlight off
+action 6 print "As I was saying\n";
+continue
+quit!
+
View
@@ -0,0 +1,26 @@
+-- main::(action-bug.pl:4)
+while (my $l = <DATA>) {
+ chomp $l;
+basename is on.
+highlight is off.
+As I was saying
+123456789012 This is a test
+As I was saying
+3456789012345This is another test
+As I was saying
+6789012345678This is yet another test
+As I was saying
+9012345678901Is this yet another test?
+As I was saying
+234567890123 Yes, this is another test.
+As I was saying
+4567890123456I think this is a test.
+As I was saying
+7890123456789Now is the time.
+As I was saying
+0123456789012For all good men.
+As I was saying
+3456789012345To come to the aid party.
+As I was saying
+678901234678 This is the tenth line.
+Action 1 set in action-bug.pl at line 6

0 comments on commit aa0f6d9

Please sign in to comment.