Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (49 sloc) 0.903 kb
635f2c9 @rgs A first regression test for the debugger, by Shlomi Fish
rgs authored
1 #!/usr/bin/perl
2
3 BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 require './test.pl';
7 }
8
9 use strict;
10 use warnings;
11
12 BEGIN {
13 if (!-c "/dev/null") {
14 print "1..0 # Skip: no /dev/null\n";
15 exit 0;
16 }
17 }
18
19 plan(1);
20
21 sub rc {
22 open RC, ">", ".perldb" or die $!;
23 print RC @_;
24 close(RC);
25 }
26
27 rc(
28 qq|
29 &parse_options("NonStop=0 TTY=/dev/null LineInfo=db.out");
30 \n|,
31
32 qq|
33 sub afterinit {
34 push(\@DB::typeahead,
35 "DB::print_lineinfo(\@{'main::_<perl5db/eval-line-bug'})",
36 'b 23',
37 'c',
38 'q',
39 );
40 }\n|,
41 );
42
43 runperl(switches => [ '-d' ], progfile => '../lib/perl5db/eval-line-bug');
44
45 my $contents;
46 {
47 local $/;
48 open I, "<", 'db.out' or die $!;
49 $contents = <I>;
50 close(I);
51 }
52
53 like($contents, qr/factorial/,
54 'The ${main::_<filename} variable in the debugger was not destroyed'
55 );
56
57 # clean up.
58
59 END {
60 unlink '.perldb', 'db.out';
61 }
Something went wrong with that request. Please try again.