diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-16 21:47:00 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-16 21:47:00 +0000 |
commit | a0cb39004565ec2396fbdb3f1949b8f13304208e (patch) | |
tree | 67b23b5671a1bf84313263478ddd1c4894a7b7ad /lib/Memoize/t/unmemoize.t | |
parent | 58a21a9b07f5f6666d09bb8c0b9bf9150baca513 (diff) | |
download | perl-a0cb39004565ec2396fbdb3f1949b8f13304208e.tar.gz |
Integrate Memoize 0.64. Few tweaks were required in
the test scripts. Note that the speed and expire*
tests take several dozen seconds to run.
p4raw-id: //depot/perl@10645
Diffstat (limited to 'lib/Memoize/t/unmemoize.t')
-rwxr-xr-x | lib/Memoize/t/unmemoize.t | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Memoize/t/unmemoize.t b/lib/Memoize/t/unmemoize.t new file mode 100755 index 0000000000..82b318c645 --- /dev/null +++ b/lib/Memoize/t/unmemoize.t @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +use lib '..'; +use Memoize qw(memoize unmemoize); + +print "1..5\n"; + +eval { unmemoize('f') }; # Should fail +print (($@ ? '' : 'not '), "ok 1\n"); + +{ my $I = 0; + sub u { $I++ } +} +memoize('u'); +my @ur = (&u, &u, &u); +print (("@ur" eq "0 0 0") ? "ok 2\n" : "not ok 2\n"); + +eval { unmemoize('u') }; # Should succeed +print ($@ ? "not ok 3\n" : "ok 3\n"); + +@ur = (&u, &u, &u); +print (("@ur" eq "1 2 3") ? "ok 4\n" : "not ok 4\n"); + +eval { unmemoize('u') }; # Should fail +print ($@ ? "ok 5\n" : "not ok 5\n"); + |