-
Notifications
You must be signed in to change notification settings - Fork 4
/
base.t
63 lines (48 loc) · 1.12 KB
/
base.t
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
61
62
63
use strict; use warnings;
use lib (-e 't' ? 't' : 'test'), 'inc';
package XXX;
BEGIN {require Thing}
use base 'Thing';
package Foo;
use base 'Spiffy';
BEGIN { @Foo::EXPORT=qw(xxx) }
sub xxx {}
package Bar;
use base 'Foo', 'Thing';
package Boo;
BEGIN { @Boo::EXPORT=qw(xxx) }
sub xxx {}
package Goo;
use base 'Boo';
package Something;
use base 'Spiffy';
BEGIN { @Something::EXPORT = qw(qwerty) }
sub qwerty {}
package SomethingGood;
use base 'Something';
package main;
use Test::More tests => 24;
ok(Thing->isa('Spiffy'));
ok(defined &XXX::thing);
ok(defined &XXX::field);
ok(defined &XXX::const);
ok(defined &Foo::field);
ok(defined &Foo::const);
ok(defined &Foo::xxx);
ok(Bar->isa('Spiffy'));
ok(Bar->isa('Foo'));
ok(Bar->isa('Thing'));
ok(defined &Bar::field);
ok(defined &Bar::const);
ok(defined &Bar::xxx);
ok(defined &Bar::thing);
ok(not Boo->isa('Spiffy'));
ok(defined &Boo::xxx);
ok(not Goo->isa('Spiffy'));
ok(Goo->isa('Boo'));
ok(not defined &Goo::xxx);
ok(SomethingGood->isa('Something'));
ok(SomethingGood->isa('Spiffy'));
ok(not SomethingGood->isa('Thing'));
ok(not defined &SomethingGood::thing);
ok(not @Spiffy::ISA);