simple rect extension test
Breno G. de Oliveira [Thu, 10 Sep 2009 00:28:45 +0000 (21:28 -0300)]
t/extendingrect.t [new file with mode: 0644]

diff --git a/t/extendingrect.t b/t/extendingrect.t
new file mode 100644 (file)
index 0000000..c1bbb9e
--- /dev/null
@@ -0,0 +1,27 @@
+package MyRect;
+use base 'SDL::Rect';
+
+sub new {
+    my $class = shift;
+    my $self = {};
+    bless $self, $class;
+}
+
+sub foo {
+    my $self = shift;
+    return $self->x;
+}
+
+package main;
+use Test::More tests => 6;
+
+my $rect = MyRect->new;
+
+isa_ok($rect, 'SDL::Rect');
+isa_ok($rect, 'MyRect');
+can_ok($rect, qw(x y top left w h width height));
+can_ok($rect, qw(new foo));
+
+$rect->x(10);
+is($rect->x, 10);
+is($rect->foo, 10);