4 use File
::Path
qw{ mkpath rmtree
};
5 use FindBin
qw{ $Bin };
6 use Test
::More tests
=> 1;
8 use parent
qw{ Exporter
};
9 our @EXPORT = qw{ fibo_check
};
11 # fibo_check( $lang, $ext, $cmd )
13 my ($lang, $ext, $cmd) = @_;
15 # clean room for the test
16 my $dir = "$Bin/tmp/$lang";
21 my $want = do { local $/; <DATA
> };
24 copy
( "$Bin/../fibonacci.txt", "$dir/fibonacci.$ext");
25 my $command = sprintf "cd $dir; $cmd 2>&1", "fibonacci.$ext";
26 my $have = qx{ $command };
28 is
( $have, $want, "language $lang test");
30 # clean after ourselve
31 rmtree
($dir) unless $ENV{POLYGLOT_DEBUG
};