[cage] Fix pgegrep, which was merely an innocent bystander in the Great Namespace...
[parrot.git] / t / oo / names.t
blob33506f9677dc64a2b9c4e984ca6e962aa5a0cdf1
1 #! parrot
2 # Copyright (C) 2007-2008, Parrot Foundation.
3 # $Id$
5 =head1 NAME
7 t/oo/names.t - Test OO name-related items
9 =head1 SYNOPSIS
11     % prove t/oo/names.t
13 =head1 DESCRIPTION
15 Tests OO features related to names and namespaces.
17 =cut
19 .HLL "perl6"
21 .namespace []
23 .sub main :main
24     .include 'test_more.pir'
26     plan(2)
28     hll_object_different_than_parrot_name()
29     hll_object_same_as_parrot_name()
30 .end
32 .sub hll_object_different_than_parrot_name
33     # works
34     $P0 = new 'Class'
35     $P0.'name'('AnObject')
36     $S0 = $P0
37     is ($S0, 'AnObject','HLL obj w/ name different than parrot obj created')
38 .end
40 .sub hll_object_same_as_parrot_name
41     # fails
42     $P0 = new 'Class'
43     push_eh OK_1
44     $P0.'name'('Object')
45     pop_eh
46     $S0 = $P0
47     ok (1, 'HLL obj created w/ same name as parrot obj')
48     .return()
49 OK_1:    
50     ok (0, 'HLL obj w/ same name as parrot obj not created')
51 .end
53 # Local Variables:
54 #   mode: pir 
55 #   fill-column: 100
56 # End:
57 # vim: expandtab shiftwidth=4 ft=pir: