Fix bug in test
[mafia.git] / t / examples.t
1 #!/usr/bin/perl
2 use 5.010001;
3 use strict;
4 use warnings;
5
6 use File::Spec::Functions qw/rel2abs/;
7 use IO::File;
8
9 my @examples;
10 BEGIN { @examples = glob 't/examples/*.pl' };
11 use Test::More tests => 1 + @examples;
12 BEGIN { use_ok('Mafia') }
13
14 for my $example (@examples) {
15 my $out;
16 close STDOUT;
17 open STDOUT, '>', \$out;
18 clean;
19
20 do(rel2abs($example));
21 $example =~ s/\.pl$//;
22 my $ok = join '', IO::File->new("$example.out", '<')->getlines;
23 is $out, $ok, substr $example, length 't/examples/'
24 }
This page took 0.023648 seconds and 4 git commands to generate.