Wednesday, 4 February 2015

6. Adding comments to test result

Note: Using PERL Module- fib.pm from post 1

Test Program(t.pl):
use strict;
use warnings;


use Test::More tests=>3;
use fib;

my @arr=(
 [1,1],
 [4,0],
 [8,1]
 );

foreach(@arr)
 {
 my $exp=pop @$_;
 my $act=fib(@$_);
 diag "Finding whether @$_ is fib";
 ok($exp==$act);
 }

Output of t.pl






No comments:

Post a Comment