Example 6-12. examples/intro/early-normal-exit.t
#!/usr/bin/perl use strict; use warnings; # example of too few tests (less than planned) use Test::More tests => 4; is `./mycalc 1 + 1`, 2, '1+1'; is `./mycalc 2 + 2`, 4, '2+2'; is `./mycalc 3 + 3`, 6, '3+3';
Directly:
1..4 ok 1 - 1+1 ok 2 - 2+2 ok 3 - 3+3 # Looks like you planned 4 tests but only ran 3.
With Harness:
early-normal-exit....ok 2/4# Looks like you planned 4 tests but only ran 3.
early-normal-exit....dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 4
Failed 1/4 tests, 75.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-----------------------------
early-normal-exit.t 1 256 4 2 50.00% 4
Failed 1/1 test scripts, 0.00% okay. 1/4 subtests failed, 75.00% okay.| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| Early Abnormal Exit | Up | More tests than planned |