Commit | Line | Data |
17cc9359 |
1 | #!./perl |
2 | |
3 | chdir 't' if -d 't'; |
4 | |
5 | sub 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). |
14 | open AUX, "<", "comp/line_debug_0.aux" or die $!; |
15 | my @lines = <AUX>; |
16 | close AUX; |
17 | my $nlines = @lines; |
18 | |
19 | print "1..", 2+$nlines, "\n"; |
20 | |
21 | $^P = 0x2; |
22 | do "comp/line_debug_0.aux"; |
23 | |
24 | ok 1, scalar(@{"_<comp/line_debug_0.aux"}) == 1+$nlines; |
25 | ok 2, !defined(${"_<comp/line_debug_0.aux"}[0]); |
26 | |
27 | for(1..$nlines) { |
28 | ok 2+$_, ${"_<comp/line_debug_0.aux"}[$_] eq $lines[$_-1]; |
29 | } |
30 | |
31 | 1; |