Example 6-7. examples/intro/t23_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';
TODO: {
local $TODO = "Once we learn how to add 3 values";
is `./mycalc 2 + 2 + 2`, 6, '2+2+2';
}
Results: 1..3 ok 1 - 1+1 ok 2 - 2+2 not ok 3 - 2+2+2 # TODO Once we learn how to add 3 values # Failed (TODO) test (t8_calc.t at line 10) # got: '4' # expected: '6' This will be more interesting once we start to use Test::Harness
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| is_deeply( complex_structure, expected_complex structure, name); | Up | TODO with Harness |