Thursday, 5 February 2015

7. Skipping test cases if user input is 1

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

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

use Test::More tests => 3;

use fib;
chomp(my $a=<>);

  SKIP: {
        skip('This is skipped',3 )
            if $a==1;


ok( fib(1) == 1 ,'tc1');
ok( fib(4) == 0 ,'tc4' );
ok( fib(8) == 1 ,'tc8' );
}

Output of t.pl
When input is 1:










When input is not 1:


No comments:

Post a Comment