[t][TT #1122] Convert t/op/numbert.t to PIR, mgrimes++
[parrot.git] / t / pmc / role.t
blobf8ffb910ef94a6c794e4eed68015bd20dc986cd7
1 #! parrot
2 # Copyright (C) 2007-2008, Parrot 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>
21 .sub main :main
22     .include 'test_more.pir'
24     plan(5)
27     $P0 = new ['Role']
28     ok(1, 'Role type exists') # or we've already died.
31     $I0 = isa $P0, 'Role'
32     is($I0, 1, 'isa Role')
35     $P0 = new ['Hash']
36     $P0['name'] = 'Wob'
37     $P1 = new ['Role'], $P0
38     ok(1, 'Created a Role initialized with a Hash')
40     $P2 = $P1.'inspect'('name')
41     $S0 = $P2
42     $I0 = $S0 == 'Wob'
43     ok($I0, 'Role name was set correctly')
46     $P2 = $P1.'inspect'('namespace')
47     $S0 = $P2
48     $I0 = $S0 == 'Wob'
49     ok($I0, 'Role namespace was set correctly')
50 .end
52 ## TODO add more tests as this is documented and implemented
54 # Local Variables:
55 #   mode: pir
56 #   fill-column: 100
57 # End:
58 # vim: expandtab shiftwidth=4 ft=pir: