diff options
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Memoize/t/expmod_t.t')
-rwxr-xr-x | gnu/usr.bin/perl/cpan/Memoize/t/expmod_t.t | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/gnu/usr.bin/perl/cpan/Memoize/t/expmod_t.t b/gnu/usr.bin/perl/cpan/Memoize/t/expmod_t.t index 3573c216854..1b63b09defe 100755 --- a/gnu/usr.bin/perl/cpan/Memoize/t/expmod_t.t +++ b/gnu/usr.bin/perl/cpan/Memoize/t/expmod_t.t @@ -1,9 +1,6 @@ -#!/usr/bin/perl - -# test caching timeout - -use lib '..'; +use strict; use warnings; use Memoize; +use Memoize::Expire; my $DEBUG = 0; my $LIFETIME = 15; @@ -11,32 +8,21 @@ my $LIFETIME = 15; my $test = 0; $| = 1; -if (-e '.fast') { - print "1..0\n"; +if ($ENV{PERL_MEMOIZE_TESTS_FAST_ONLY}) { + print "1..0 # Skipped: Slow tests disabled\n"; exit 0; } print "# Testing the timed expiration policy.\n"; print "# This will take about thirty seconds.\n"; -print "1..26\n"; - -require Memoize::Expire; -++$test; print "ok $test - Expire loaded\n"; - -sub now { -# print "NOW: @_ ", time(), "\n"; - time; -} +print "1..24\n"; tie my %cache => 'Memoize::Expire', LIFETIME => $LIFETIME; - -memoize 'now', - SCALAR_CACHE => [HASH => \%cache ], - LIST_CACHE => 'FAULT' - ; - -++$test; print "ok $test - function memoized\n"; +memoize sub { time }, + SCALAR_CACHE => [ HASH => \%cache ], + LIST_CACHE => 'FAULT', + INSTALL => 'now'; my (@before, @after, @now); |