File: export3.t

package info (click to toggle)
libspiffy-perl 0.21-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 256 kB
  • ctags: 99
  • sloc: perl: 1,067; makefile: 50
file content (27 lines) | stat: -rw-r--r-- 446 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
22
23
24
25
26
27
use lib 't';
use strict;
use warnings;

package A;
use Spiffy -base;
BEGIN {@A::EXPORT_OK = qw($A1 $A2)}
$A::A1 = 5;
$A::A2 = 10;

package B;
use base 'A';
BEGIN {@B::EXPORT_OK = qw($A2 $A3)}
$B::A2 = 15;
$B::A3 = 20;

package main;
no warnings;
use Test::More tests => 7;
BEGIN {B->import(qw($A1 $A2 $A3 $A4))}
ok(defined $main::A1);
ok(defined $main::A2);
ok(defined $main::A3);
ok(not defined $main::A4);
is($A1, 5);
is($A2, 10);
is($A3, 20);