]> git.imager.perl.org - imager.git/blob - t/x40checklib.t
set_file_limits(reset => 1) now resets to defaults, not zero.
[imager.git] / t / x40checklib.t
1 #!perl -w
2 #
3 # Each sub-module ships with our custom Devel::CheckLib, make sure
4 # they all match
5 use strict;
6 use Test::More;
7
8 my @subs = qw(FT2 GIF JPEG PNG T1 TIFF W32);
9
10 plan tests => 1 + @subs;
11
12 # load the base file
13
14 my $base = load("inc/Devel/CheckLib.pm");
15
16 ok($base, "Loaded base file");
17
18 for my $sub (@subs) {
19   my $data = load("$sub/inc/Devel/CheckLib.pm");
20
21   # I'd normally use is() here, but it's excessively noisy when
22   # comparing this size of data
23   ok(defined($data) && $data eq $base, "check $sub");
24 }
25
26 sub load {
27   my ($filename) = @_;
28
29   if (open my $f, "<", $filename) {
30     my $data = do { local $/; <$f> };
31     close $f;
32
33     return $data;
34   }
35   else {
36     diag "Cannot load $filename: $!\n";
37     return;
38   }
39 }