This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Allow test_bootstrap.t to run from the top level
[perl5.git] / t / comp / line_debug.t
CommitLineData
17cc9359
Z
1#!./perl
2
3chdir 't' if -d 't';
4
5sub ok {
6 my($test,$ok) = @_;
7 print "not " unless $ok;
8 print "ok $test\n";
9}
10
11# The auxiliary file contains a bunch of code that systematically exercises
12# every place that can call lex_next_chunk() (except for the one that's not
13# used by the main Perl parser).
14open AUX, "<", "comp/line_debug_0.aux" or die $!;
15my @lines = <AUX>;
16close AUX;
17my $nlines = @lines;
18
19print "1..", 2+$nlines, "\n";
20
21$^P = 0x2;
22do "comp/line_debug_0.aux";
23
24ok 1, scalar(@{"_<comp/line_debug_0.aux"}) == 1+$nlines;
25ok 2, !defined(${"_<comp/line_debug_0.aux"}[0]);
26
27for(1..$nlines) {
28 ok 2+$_, ${"_<comp/line_debug_0.aux"}[$_] eq $lines[$_-1];
29}
30
311;