File: pmc.t

package info (click to toggle)
libmodule-compile-perl 0.38-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 332 kB
  • sloc: perl: 1,831; makefile: 2
file content (60 lines) | stat: -rw-r--r-- 1,060 bytes parent folder | download | duplicates (5)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
my $t; use lib ($t = -e 't' ? 't' : 'test'), 'inc';
use TestModuleCompile tests => 1;

use lib "$t/lib";

BEGIN { unlink "$t/lib/Foo.pmc" }

use Foo;

run_is module => 'pmc';

sub fixpath {
    s/t/$t/;
    return $_;
}

sub fixup {
    s/0\.\d\d/0.XX/;
    s/0x[0-9A-Fa-f]{4,8}/0xXXXXXXXX/;
}

END { unlink "$t/lib/Foo.pmc" }

__DATA__
=== Compile Foo.pm to Foo.pmc
--- module fixpath read_file fixup: t/lib/Foo.pmc
--- pmc -trim
# Generated by Indented 0 (Module::Compile 0.XX) - do not edit!
################((( 32-bit Checksum Validator III )))################
#line 1
BEGIN { use 5.006; local (*F, $/); ($F = __FILE__) =~ s!c$!!; open(F)
or die "Cannot open $F: $!"; binmode(F, ':crlf'); if (unpack('%32N*',
$F=readline(*F)) != 0xXXXXXXXX) { use Filter::Util::Call; my $f = $F;
filter_add(sub { filter_del(); 1 while &filter_read; $_ = $f; 1; })}}
#line 1
package Foo;

=head1 Tricksy
__END__
=cut


sub greetings {
    print "Hello " . shift;
}


sub farewell {
    print "Goodbye " . shift;
}

1;

__END__

=head1 NAME

t::Foo - Hello and Goodbye

=cut