lib/perl5db/t/test-l-statement-1 Tests for the Perl debugger
lib/perl5db/t/test-l-statement-2 Tests for the Perl debugger
lib/perl5db/t/test-m-statement-1 Tests for the Perl debugger
+lib/perl5db/t/test-PrintRet-option-1 Tests for the Perl debugger
lib/perl5db/t/test-r-statement Tests for the Perl debugger
lib/perl5db/t/test-warnLevel-option-1 Tests for the Perl debugger
lib/perl5db/t/test-w-statement-1 Tests for the Perl debugger
}
}
-plan(97);
+plan(98);
my $rc_filename = '.perldb';
);
}
+# Test the o PrintRet=1 command
+{
+ my $wrapper = DebugWrap->new(
+ {
+ cmds =>
+ [
+ 'o PrintRet=1',
+ 'b 29',
+ 'c',
+ q/$x = 's';/,
+ 'b 10',
+ 'c',
+ 'r',
+ 'q',
+ ],
+ prog => '../lib/perl5db/t/test-PrintRet-option-1',
+ }
+ );
+
+ $wrapper->contents_like(
+ qr/scalar context return from main::return_scalar: 20024/,
+ "Test o PrintRet=1",
+ );
+}
+
END {
1 while unlink ($rc_filename, $out_fn);
}
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my ($x, $y);
+
+sub return_scalar
+{
+ $y++;
+
+ return "20024";
+}
+
+sub return_list
+{
+ $y++;
+
+ return ("Foo", "Bar", "Baz");
+}
+
+sub return_void
+{
+ $y++;
+
+ return;
+}
+
+$y++;
+
+# Choose one based on $x
+#
+if ($x eq "s")
+{
+ my $s = return_scalar();
+}
+elsif ($x eq "l")
+{
+ my @l = return_list();
+}
+else
+{
+ return_void();
+ $y++;
+}
+