]>
Commit | Line | Data |
---|---|---|
344e176e | 1 | #!/usr/bin/perl |
76b92037 MG |
2 | use 5.010001; |
3 | use strict; | |
344e176e MG |
4 | use warnings; |
5 | ||
061dc5c7 | 6 | use File::Spec::Functions qw/rel2abs/; |
344e176e | 7 | use IO::Handle; |
f1171346 MG |
8 | |
9 | my @examples; | |
76b92037 MG |
10 | BEGIN { @examples = glob 't/examples/*.pl' }; |
11 | use Test::More tests => 1 + @examples; | |
12 | BEGIN { use_ok('Mafia') } | |
f1171346 MG |
13 | |
14 | for my $example (@examples) { | |
40af1ba2 MG |
15 | my $out; |
16 | close STDOUT; | |
17 | open STDOUT, '>', \$out; | |
18 | clean; | |
f1171346 | 19 | |
061dc5c7 | 20 | do rel2abs $example; |
76b92037 | 21 | $example =~ s/\.pl$//; |
344e176e | 22 | my $ok = join '', IO::File->new("$example.out", '<')->getlines; |
344e176e | 23 | is $out, $ok, substr $example, length 't/examples/' |
f1171346 | 24 | } |