[cage] Fix pgegrep, which was merely an innocent bystander in the Great Namespace...
[parrot.git] / t / pmc / packfileannotation.t
blob91dc224f755c6a3f967eaf7514d3209811fbecaf
1 #!parrot
2 # Copyright (C) 2006-2009, Parrot Foundation.
4 =head1 NAME
6 t/pmc/packfileannotation.t - test the PackfileAnnotation PMC
8 =head1 SYNOPSIS
10     % prove t/pmc/packfileannotation.t
12 =head1 DESCRIPTION
14 Tests the PackfileAnnotation PMC.
16 =cut
18 # PackfileAnnotation constructor
19 .sub 'test' :main
20 .include 'test_more.pir'
21     .local pmc pa
23     plan(5)
25     pa = new ['PackfileAnnotation']
26     $I0 = defined pa
27     ok($I0, 'PackfileAnnotation created')
29     pa.'set_name'('line')
30     pa.'set_offset'(115200)
31     pa = 42
33     $S0 = pa.'get_name'()
34     is($S0, 'line',  'Name stored and fetched')
35     $I0 = pa.'get_offset'()
36     is($I0, 115200, 'Offset stored and fetched')
37     $I0 = pa
38     is($I0, 42, 'Value stored and fetched')
40     # We can't fetch string from integer annotation
41     push_eh check
42     $I1 = 1
43     $S0 = pa
44     $I0 = 0
45   check:
46     pop_eh
47     ok($I0, "Can't fetch wrong value from Annotation")
49 .end
51 # Local Variables:
52 #   mode: cperl
53 #   cperl-indent-level: 4
54 #   fill-column: 100
55 # End:
56 # vim: expandtab shiftwidth=4 ft=pir: