You are looking at a very old, but free version of the course. If you are interesed the most recent version, check it out on the Perl Maven site.

5.4. Calculator test with expected results

So we should write the expected value next to the correct one:

Example 5-4. examples/intro/t02_calc.t

#!/usr/bin/perl
use strict;
use warnings;

system "./mycalc 1  + 1";
print " 2\n";
system "./mycalc 2 + 2";
print " 4\n";
system "./mycalc 2 + 2 + 2";
print " 6\n";

Output:

Example 5-5. examples/intro/t02_calc.out

2 2
4 4
4 6

Now it is better.


If you are interested in on-site trainings by the author, please contact me directly.