File: 05___DATA__.t

package info (click to toggle)
libsub-wrappackages-perl 1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 168 kB
  • ctags: 24
  • sloc: perl: 247; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 749 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
28
29
use strict;
use warnings;

use lib 't/lib';

use Test::More tests => 9;

use Sub::WrapPackages (
    packages => [qw(
        Module::With::Data::Segment
        Module::With::Both::Segments
        Module::With::END::Segment
    )],
    pre      => sub {
        ok(1, "$_[0] pre-wrapper")
    },
    post     => sub {
        ok(1, "$_[0] post-wrapper")
    }
);

use Module::With::Data::Segment;
use Module::With::Both::Segments;
use Module::With::END::Segment;

ok(Module::With::Data::Segment::foo(), "wrapped sub in a module with a __DATA__ segment works");
ok(Module::With::Both::Segments::foo(), "wrapped sub in a module with __DATA__ and __END__ works");
ok(Module::With::END::Segment::foo(), "wrapped sub in a module with __END__ works");