http://www.perlmonks.org?node_id=1016102

sem999 has asked for the wisdom of the Perl Monks concerning the following question:

Test::More confuse me;

1. the code

#!/usr/local/bin/perl use Test::More; print "4 - 2 = " , ( 4 - 2 ) . "\n"; cmp_ok ( 4 - 2 , '==', 2, "maths works" ); print "\n"; print "-2.3 - -0.6 = " . ( -2.3 - -0.6 ) ."\n"; cmp_ok ( -2.3 - -0.6 , '==', -1.7, "maths works" ); done_testing();

2. the output

# ./p.pl 4 - 2 = 2 ok 1 - maths works -2.3 - -0.6 = -1.7 not ok 2 - maths works # Failed test 'maths works' # at ./p.pl line 13. # got: -1.7 # expected: -1.7 1..2 # Looks like you failed 1 test of 2.