| 1 | #!/usr/bin/perl -w | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | ▶ | use Experimental::Sample; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Test::Unit::Procedural; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 7 | |||
| 8 | use constant DEBUG => 0; | ||
| 9 | |||
| 10 | # code to be tested will be somewhere around here | ||
| 11 | |||
| 12 | # define tests, set_up and tear_down | ||
| 13 | |||
| 14 | sub test_ok_1 { | ||
| 15 | assert(23 == 23); | ||
| 16 | } | ||
| 17 | |||
| 18 | sub test_ok_2 { | ||
| 19 | assert(42 == 42); | ||
| 20 | } | ||
| 21 | |||
| 22 | sub test_ok_3 { | ||
| 23 | my $sample = new Experimental::Sample(); | ||
| 24 | $sample->name( 'Joe' ); | ||
| 25 | assert( 'Joe' eq $sample->name() ); | ||
| 26 | } | ||
| 27 | |||
| 28 | sub set_up { | ||
| 29 | print "hello world\n" if DEBUG; | ||
| 30 | } | ||
| 31 | |||
| 32 | sub tear_down { | ||
| 33 | print "leaving world again\n" if DEBUG; | ||
| 34 | } | ||
| 35 | |||
| 36 | # and run them | ||
| 37 | |||
| 38 | |||
| 39 | create_suite( 'Experimental::Sample' ); | ||
| 40 | create_suite; | ||
| 41 | run_suite(); | ||