simple rect extension test
[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 = {};
7     bless $self, $class;
8 }
9
10 sub foo {
11     my $self = shift;
12     return $self->x;
13 }
14
15 package main;
16 use Test::More tests => 6;
17
18 my $rect = MyRect->new;
19
20 isa_ok($rect, 'SDL::Rect');
21 isa_ok($rect, 'MyRect');
22 can_ok($rect, qw(x y top left w h width height));
23 can_ok($rect, qw(new foo));
24
25 $rect->x(10);
26 is($rect->x, 10);
27 is($rect->foo, 10);