Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Test::Simple - too many tests

When there are more OKs than planned the script will also print a comment about it.

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";
use MySimpleCalc qw(sum);

use Test::Simple tests => 2;

ok( sum(1, 1) == 2 );
ok( sum(2, 2) == 4 );
ok( sum(3, 3) == 6 );

Output:

1..2
ok 1
ok 2
ok 3
# Looks like you planned 2 tests but ran 3.
$ echo $?
255
> echo %ERRORLEVEL%
255