Example 5-19. examples/intro/t13_calc.t
#!/usr/bin/perl
use strict;
use warnings;
use Test::Simple "no_plan";
open my $fh, "<", "calc.txt" or die $!;
while ( my $line = <$fh> ) {
chomp $line;
next if $line =~ /^\s*$/;
next if $line =~ /^#/;
my ( $exp, $res ) = split /\s*=\s*/, $line;
ok( `./mycalc $exp` == $res, $exp );
}
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| Forget about your "plan", use "no_plan" | Up | Harness |