* t/oo/composition.t, t/oo/mro-c3.t, t/op/calling.t:
[parrot.git] / t / pmc / role.t
blobf5a07907876c7f9489941ce12543c04796d59f5b
1 #! parrot
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
5 =head1 NAME
7 t/pmc/role.t - test the Role PMC
9 =head1 SYNOPSIS
11     % prove t/pmc/role.t
13 =head1 DESCRIPTION
15 Tests the Role PMC.
17 =cut
19 # L<PDD15/Role PMC API>
20 # TODO fix smartlinks once this is specced
22 .sub main :main
23     .include 'include/test_more.pir'
25     plan(5)
28     $P0 = new 'Role'
29     ok(1, 'Role type exists') # or we've already died.
32     $I0 = isa $P0, 'Role'
33     is($I0, 1, 'isa Role')
36     $P0 = new 'Hash'
37     $P0['name'] = 'Wob'
38     $P1 = new 'Role', $P0
39     ok(1, 'Created a Role initialized with a Hash')
41     $P2 = $P1.inspect('name')
42     $S0 = $P2
43     $I0 = $S0 == 'Wob'
44     ok($I0, 'Role name was set correctly')
47     $P2 = $P1.inspect('namespace')
48     $S0 = $P2
49     $I0 = $S0 == 'Wob'
50     ok($I0, 'Role namespace was set correctly')
51 .end
53 ## TODO add more tests as this is documented and implemented
55 # Local Variables:
56 #   mode: cperl
57 #   cperl-indent-level: 4
58 #   fill-column: 100
59 # End:
60 # vim: expandtab shiftwidth=4: