simple rect extension test
[sdlgit/SDL_perl.git] / t / extendingrect.t
CommitLineData
98ce5b8c 1package MyRect;
2use base 'SDL::Rect';
3
4sub new {
5 my $class = shift;
6 my $self = {};
7 bless $self, $class;
8}
9
10sub foo {
11 my $self = shift;
12 return $self->x;
13}
14
15package main;
16use Test::More tests => 6;
17
18my $rect = MyRect->new;
19
20isa_ok($rect, 'SDL::Rect');
21isa_ok($rect, 'MyRect');
22can_ok($rect, qw(x y top left w h width height));
23can_ok($rect, qw(new foo));
24
25$rect->x(10);
26is($rect->x, 10);
27is($rect->foo, 10);