Print only ok/not ok
Good so we are going to implement that now. For every test unit we
create an if statement that will print either "ok" or "not ok"
depending on the result.
examples/test-simple/tests/t05.pl
use strict; use warnings; use FindBin; use lib "$FindBin::Bin/../lib"; use MySimpleCalc qw(sum); if (sum(1, 1) == 2) { print "ok\n"; } else { print "not ok\n"; } if (sum(2, 2) == 4) { print "ok\n"; } else { print "not ok\n"; } if (sum(2, 2, 2) == 6) { print "ok\n"; } else { print "not ok\n"; }
Output:
ok ok not ok
The output is as we expected. I mean we already know there is a bug somewhere. We are supposed to report it to the developers, but right now we are focusing on improving our test suite and its reporting capabilities.