1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!perl
use strict;
use warnings;
use lib 't/inc';
use nptestutils;
use Test::More;
if(!$ENV{AUTOMATED_TESTING}) {
plan skip_all => "slurping is too slow so skipping, set AUTOMATED_TESTING to run this";
} else {
eval 'use Number::Phone::UK::Data';
die($@) if($@);
diag("NB: this test takes a few minutes and lots of memory");
my $time = time();
Number::Phone::UK::Data::slurp();
my $first_db = Number::Phone::UK::Data::db();
ok(time() - $time > 2, "the first slurp took ages");
$time = time();
Number::Phone::UK::Data::slurp();
ok(time() - $time < 2, "trying to slurp again is fast cos it does nothing");
is($first_db, Number::Phone::UK::Data::db(), "both slurps returned the same reference");
use lib '.';
require 't/uk_data.t';
}
|