| 1 | # Before `make install' is performed this script should be runnable with | ||
| 2 | # `make test'. After `make install' it should work as `perl 1.t' | ||
| 3 | |||
| 4 | ######################### | ||
| 5 | |||
| 6 | # change 'tests => 1' to 'tests => last_test_to_print'; | ||
| 7 | |||
| 8 | 1 | ▶ | use Test::More tests => 4; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | BEGIN { use_ok('Acme::RTB') }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | ######################### | ||
| 12 | |||
| 13 | # Insert your test code below, the Test::More module is use()ed here so read | ||
| 14 | # its man page ( perldoc Test::More ) for help writing this test script. | ||
| 15 | |||
| 16 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | |||
| 19 | 1 | my $rand; | |
| 20 | 1 | $rand.=chr(rand(25)+65) for 1..10; | |
| 21 | 1 | my $robot = Acme::RTB->new({ Name => 'Anarion PerlBot 1.0', | |
| 22 | Colour => 'ff0000 ff0000', | ||
| 23 | Log => "/tmp/$$-$rand.log"} ); | ||
| 24 | |||
| 25 | 1 | ok( $robot ); | |
| 26 | 1 | ok( $robot->modify_action( Radar => \&my_radar ) ); | |
| 27 | 1 | ok( $robot->RotateAmount(7, 0.5, 2) ); | |
| 28 | |||
| 29 | 0 | ▶ | sub my_radar { } |
|
Subroutine
my_radar: not called CC=1 SCAR=0.0
| |||
| 30 | 1 | unlink("/tmp/$$-$rand.log"); | |