File: sub_END.t

package info (click to toggle)
libppr-perl 0.001010-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 932 kB
  • sloc: perl: 5,987; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 529 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use warnings;
use strict;

use Test::More;
plan tests => 3;

use PPR;

my $src = q{
    my $ __END__ = '__END__';

    sub __END__ {
        print $ __END__
    }
    & __END__
};

ok $src =~ m{ \A (?&PerlEntireDocument) \Z $PPR::GRAMMAR }xms => 'Matched sub __END__';

$src =~ s/__END__/__DATA__/g;
ok $src =~ m{ \A (?&PerlEntireDocument) \Z $PPR::GRAMMAR }xms => 'Matched sub __DATA__';

$src =~ s/__DATA_/__OTHER__/g;
ok $src =~ m{ \A (?&PerlEntireDocument) \Z $PPR::GRAMMAR }xms => 'Matched sub __OTHER__';

done_testing();