PageRenderTime 3706ms CodeModel.GetById 23ms RepoModel.GetById 43ms 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
Possible License(s): AGPL-1.0, GPL-2.0
  1. #!perl
  2. use strict;
  3. use warnings;
  4. use Test::More tests => 10;
  5. use_ok('SDL::Rect');
  6. my $rect = SDL::Rect->new( 0, 0, 0, 0 );
  7. isa_ok( $rect, 'SDL::Rect' );
  8. is( $rect->x(), 0, 'x is 0' );
  9. is( $rect->y(), 0, 'y is 0' );
  10. is( $rect->w(), 0, 'w is 0' );
  11. is( $rect->h(), 0, 'h is 0' );
  12. $rect->x(1);
  13. $rect->y(2);
  14. $rect->w(3);
  15. $rect->h(4);
  16. is( $rect->x(), 1, 'x is now 1' );
  17. is( $rect->y(), 2, 'y is now 2' );
  18. is( $rect->w(), 3, 'w is now 3' );
  19. is( $rect->h(), 4, 'h is now 4' );
  20. sleep(2);