From: Shlomi Fish Date: Thu, 13 Sep 2012 13:52:54 +0000 (+0300) Subject: Add a test for the source command. X-Git-Tag: upstream/5.20.0~4852^2~174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5442f9499489fe7ea1865eab38e4e8be12abddd1;p=platform%2Fupstream%2Fperl.git Add a test for the source command. --- diff --git a/MANIFEST b/MANIFEST index f99c703..ff83e24 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4332,6 +4332,7 @@ lib/perl5db/t/proxy-constants Tests for the Perl debugger lib/perl5db/t/rt-104168 Tests for the Perl debugger lib/perl5db/t/rt-61222 Tests for the Perl debugger lib/perl5db/t/rt-66110 Tests for the Perl debugger +lib/perl5db/t/source-cmd-test.perldb TTests for the Perl debugger lib/perl5db/t/symbol-table-bug Tests for the Perl debugger lib/perl5db/t/taint Tests for the Perl debugger lib/perl5db/t/test-l-statement-1 Tests for the Perl debugger diff --git a/lib/perl5db.t b/lib/perl5db.t index 5b60c54..a9d49d6 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -28,7 +28,7 @@ BEGIN { } } -plan(79); +plan(80); my $rc_filename = '.perldb'; @@ -1903,6 +1903,38 @@ sub _calc_trace_wrapper ); } +# Test the 'source' command. +{ + my $wrapper = DebugWrap->new( + { + cmds => + [ + 'source ../lib/perl5db/t/source-cmd-test.perldb', + # If we have a 'q' here, then the typeahead will override the + # input, and so it won't be reached - solution: + # put a q inside the .perldb commands. + # ( This may be a bug or a misfeature. ) + ], + prog => '../lib/perl5db/t/disable-breakpoints-1', + } + ); + + $wrapper->contents_like(qr# + ^3:\s+my\ \$dummy\ =\ 0;\n + 4\s*\n + 5:\s+\$x\ =\ "FirstVal";\n + 6\s*\n + 7:\s+\$dummy\+\+;\n + 8\s*\n + 9:\s+\$x\ =\ "SecondVal";\n + 10\s*\n + #msx, + 'Test the source command (along with l)', + ); + + print $wrapper->get_output(), "\n"; +} + END { 1 while unlink ($rc_filename, $out_fn); } diff --git a/lib/perl5db/t/source-cmd-test.perldb b/lib/perl5db/t/source-cmd-test.perldb new file mode 100644 index 0000000..41a7365 --- /dev/null +++ b/lib/perl5db/t/source-cmd-test.perldb @@ -0,0 +1,2 @@ +l 3-10 +q