~ubuntu-branches/ubuntu/trusty/libperl5i-perl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/Meta/linear_isa.t

  • Committer: Bazaar Package Importer
  • Author(s): Ivan Kohler
  • Date: 2010-05-08 17:42:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100508174200-7ogg0zrimh9gvcuw
Tags: upstream-2.1.1
ImportĀ upstreamĀ versionĀ 2.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use perl5i::latest;
 
4
use Test::More;
 
5
 
 
6
is_deeply [UNIVERSAL->mc->linear_isa],    ["UNIVERSAL"];
 
7
is_deeply [DoesNotExist->mc->linear_isa], [qw(DoesNotExist UNIVERSAL)];
 
8
 
 
9
# Set up a good ol diamond inheritance.
 
10
{
 
11
    package Child;
 
12
    use perl5i::latest;
 
13
    our @ISA = qw(Mom Dad);
 
14
 
 
15
    package Mom;
 
16
    our @ISA = qw(GrandParents);
 
17
 
 
18
    package Dad;
 
19
    our @ISA = qw(GrandParents);
 
20
 
 
21
    package GrandParents;
 
22
}
 
23
 
 
24
is_deeply [Mom->mc->linear_isa],   [qw(Mom GrandParents UNIVERSAL)];
 
25
is_deeply [Child->mc->linear_isa], [qw(Child Mom Dad GrandParents UNIVERSAL)]
 
26
  or diag explain( [Child->mc->linear_isa] );
 
27
 
 
28
is_deeply scalar Mom->mc->linear_isa, [qw(Mom GrandParents UNIVERSAL)], "scalar context";
 
29
 
 
30
done_testing();