X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fperl5db.t;h=2cf7958d339625d0aaaf83acf09143f62b4c11c5;hb=fe0438b3fdd7184c1a19b7c24a3a26460d03083a;hp=5323f79c7b05459972c4b7387a15486886387bd3;hpb=3e5e55bd9605a684d64a1a191319fa2d90836414;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/perl5db.t b/lib/perl5db.t index 5323f79..2cf7958 100644 --- a/lib/perl5db.t +++ b/lib/perl5db.t @@ -14,6 +14,16 @@ BEGIN { print "1..0 # Skip: no /dev/null\n"; exit 0; } +my $dev_tty = '/dev/tty'; + $dev_tty = 'TT:' if ($^O eq 'VMS'); + if (!-c $dev_tty) { + print "1..0 # Skip: no $dev_tty\n"; + exit 0; + } + if ($ENV{PERL5DB}) { + print "1..0 # Skip: \$ENV{PERL5DB} is already set to '$ENV{PERL5DB}'\n"; + exit 0; + } } plan(1); @@ -27,23 +37,32 @@ sub rc { chmod 0644, ".perldb"; } +my $target = '../lib/perl5db/t/eval-line-bug'; + rc( qq| - &parse_options("NonStop=0 TTY=/dev/null LineInfo=db.out"); + &parse_options("NonStop=0 TTY=db.out LineInfo=db.out"); \n|, qq| sub afterinit { push(\@DB::typeahead, - "DB::print_lineinfo(\@{'main::_ [ '-d' ], progfile => '../lib/perl5db/eval-line-bug'); +{ + local $ENV{PERLDB_OPTS} = "ReadLine=0"; + runperl(switches => [ '-d' ], progfile => $target); +} my $contents; { @@ -53,12 +72,12 @@ my $contents; close(I); } -like($contents, qr/factorial/, +like($contents, qr/sub factorial/, 'The ${main::_