PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/t/core_rect.t

http://github.com/PerlGameDev/SDL
Perl | 23 lines | 19 code | 3 blank | 1 comment | 0 complexity | 884e67d33aa673580b886f68079bd203 MD5 | raw file
 1#!perl
 2use strict;
 3use warnings;
 4use Test::More tests => 10;
 5use_ok('SDL::Rect');
 6
 7my $rect = SDL::Rect->new( 0, 0, 0, 0 );
 8isa_ok( $rect, 'SDL::Rect' );
 9is( $rect->x(), 0, 'x is 0' );
10is( $rect->y(), 0, 'y is 0' );
11is( $rect->w(), 0, 'w is 0' );
12is( $rect->h(), 0, 'h is 0' );
13
14$rect->x(1);
15$rect->y(2);
16$rect->w(3);
17$rect->h(4);
18
19is( $rect->x(), 1, 'x is now 1' );
20is( $rect->y(), 2, 'y is now 2' );
21is( $rect->w(), 3, 'w is now 3' );
22is( $rect->h(), 4, 'h is now 4' );
23sleep(2);