Fixed the pod path in archive
[sdlgit/SDL_perl.git] / t / extendingrect.t
1 package MyRect;
2 use base 'SDL::Rect';
3
4 sub new {
5         my $class = shift;
6         my $self = $class->SUPER::new(@_);
7         unless (ref $self) {
8                 require Carp;
9                 Carp::croak SDL::GetError();
10         }
11         return bless $self => $class;;
12
13 }
14
15 sub foo {
16         my $self = shift;
17         return $self->x;
18 }
19
20 package main;
21 use Test::More tests => 6;
22
23 my $rect = MyRect->new(0,0,0,0);
24
25 isa_ok($rect, 'SDL::Rect');
26 isa_ok($rect, 'MyRect');
27 can_ok($rect, qw(x y w h));
28 can_ok($rect, qw(new foo));
29
30 $rect->x(10);
31 is($rect->x, 10);
32 is($rect->foo, 10);