File: 03b_inh_in_same_file_late_loading.t

package info (click to toggle)
libsub-wrappackages-perl 2.02-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 292 kB
  • sloc: perl: 664; sh: 3; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!perl

use strict;
use Test::More tests => 4;

use lib 't/lib';

my $post = '';
use Sub::WrapPackages (
    packages    => [qw(Banana)],
    post         => sub { $post .= $_[0]; },
    wrap_inherited => 1,
);
use Banana;

ok(Banana->peel() eq 'ready to eat', "got right response");
is($post, 'Banana::peel', 'post is good for non-inherited method');

$post = '';
ok(Banana->eat() eq 'yum yum', "got right response");
is($post, 'Banana::eat', 'post is good for inherited method');