This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
typo fix for obj pod
[perl5.git] / t / comp / line_debug.t
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;