3 # Copyright (C) 2003 Tels
4 # Copyright (C) 2004 David J. Goehrig
6 # basic testing of SDL::Rect
9 unshift @INC, 'blib/lib','blib/arch';
18 use_ok( 'SDL::Rect' );
20 can_ok ('SDL::Rect', qw/
27 my $rect = SDL::Rect->new();
29 # creating with defaults
30 is (ref($rect),'SDL::Rect','new went ok');
31 is ($rect->x(), 0, 'x is 0');
32 is ($rect->y(), 0, 'y is 0');
33 is ($rect->width(), 0, 'w is 0');
34 is ($rect->height(), 0, 'h is 0');
36 # set and get at the same time
37 is ($rect->x(12), 12, 'x is now 12');
38 is ($rect->y(123), 123, 'y is now 12');
39 is ($rect->width(45), 45, 'w is now 45');
40 is ($rect->height(67), 67, 'h is now 67');
43 is ($rect->x(), 12, 'x is 12');
44 is ($rect->y(), 123, 'y is 12');
45 is ($rect->width(), 45, 'w is 45');
46 is ($rect->height(), 67, 'h is 67');