5.4. Calculator test with expected resultsSo 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: Now it is better.
|
Follow me: