It would be much better to see the expected value and the actually received value. This usually helps in locating the problem.
Example 6-2. examples/intro/t22_calc.t
#!/usr/bin/perl use strict; use warnings; use Test::More tests => 3; is `./mycalc 1 + 1`, 2, '1+1'; is `./mycalc 2 + 2`, 4, '2+2'; is `./mycalc 2 + 2 + 2`, 6, '2+2+2';
Result
$ perl t7_calc.t
1..3
ok 1 - 1+1
ok 2 - 2+2
not ok 3 - 2+2+2
# Failed test (t7_calc.t at line 7)
# got: '4'
# expected: '6'
# Looks like you failed 1 tests of 3.See, in this case we can already guess that it cannot add 3 values.
compares using eq
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| Test::More ok( trueness, name); | Up | diag(just_a_message ); |