This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl5db] Fix a bug - with a test.
authorShlomi Fish <shlomif@shlomifish.org>
Mon, 1 Oct 2012 11:16:33 +0000 (13:16 +0200)
committerRicardo Signes <rjbs@cpan.org>
Mon, 12 Nov 2012 14:18:30 +0000 (09:18 -0500)
The problem was that the arguments in print_help were not extracted correctly.

lib/perl5db.pl
lib/perl5db.t

index 0fac7f3..8c5b6c5 100644 (file)
@@ -7814,7 +7814,7 @@ C<Term::ReadLine::TermCap>).
 =cut
 
 sub print_help {
-    my $help_str = (@_);
+    my $help_str = shift;
 
     # Restore proper alignment destroyed by eeevil I<> and B<>
     # ornaments: A pox on both their houses!
index dfd99b7..ec50e74 100644 (file)
@@ -28,7 +28,7 @@ BEGIN {
     }
 }
 
-plan(104);
+plan(105);
 
 my $rc_filename = '.perldb';
 
@@ -2302,6 +2302,26 @@ sub _calc_trace_wrapper
     );
 }
 
+# Test the final message.
+{
+    my $wrapper = DebugWrap->new(
+        {
+            cmds =>
+            [
+                'c',
+                'q',
+            ],
+            prog => '../lib/perl5db/t/test-warnLevel-option-1',
+        }
+    );
+
+    $wrapper->contents_like(qr/
+        ^Debugged\ program\ terminated\.
+        /msx,
+        'Test the final "Debugged program terminated" message.',
+    );
+}
+
 # Test the o inhibit_exit=0 command
 {
     my $wrapper = DebugWrap->new(