This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
bump versions of perl modules updated in AmigaOS branch
[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";
5239c153 9 $ok;
17cc9359
Z
10}
11
12# The auxiliary file contains a bunch of code that systematically exercises
13# every place that can call lex_next_chunk() (except for the one that's not
14# used by the main Perl parser).
15open AUX, "<", "comp/line_debug_0.aux" or die $!;
16my @lines = <AUX>;
17close AUX;
18my $nlines = @lines;
19
20print "1..", 2+$nlines, "\n";
21
22$^P = 0x2;
23do "comp/line_debug_0.aux";
24
25ok 1, scalar(@{"_<comp/line_debug_0.aux"}) == 1+$nlines;
26ok 2, !defined(${"_<comp/line_debug_0.aux"}[0]);
27
28for(1..$nlines) {
5239c153
FC
29 if (!ok 2+$_, ${"_<comp/line_debug_0.aux"}[$_] eq $lines[$_-1]) {
30 print "# Got: ", ${"_<comp/line_debug_0.aux"}[$_]//"undef\n";
31 print "# Expected: $lines[$_-1]";
32 }
17cc9359
Z
33}
34
351;