# allow a 2 pixel difference between the values in array ref 1 and array
# ref 2

# pull Dustismo_Sans from the Debian package fonts-dustin
use File::Copy;
use File::Path qw(make_path);
copy("/usr/share/fonts/truetype/dustin/Dustismo.ttf", "./Dustismo_Sans.ttf")
    or die "copy failed: $!";
make_path('demo');

eval { local $SIG{'__WARN__'}; require Test::More };
if ($@)
{
    # Test::More is not available
    print "1..1\n";
    print "ok 1 # skip Skipping all tests: No Test::More\n";
    exit 0;
}

sub main::aeq
{
    my ($a1, $a2, $e) = @_;
    $e = 0 unless $e;
    return 0 if @$a1 != @$a2;
    for (my $i = 0; $i < @$a1; $i++)
    {
        return 0 if $a1->[$i] > $a2->[$i] + $e || 
                    $a1->[$i] < $a2->[$i] - $e;
    }
    return 1;
}

1;
