ext/Tie-File/t/40_abs_cache.t Unit tests for Tie::File::Cache
ext/Tie-File/t/41_heap.t Unit tests for Tie::File::Heap
ext/Tie-File/t/42_offset.t Unit tests for the offset method
+ext/Tie-Memoize/lib/Tie/Memoize.pm Base class for memoized tied hashes
+ext/Tie-Memoize/t/Tie-Memoize.t Test for Tie::Memoize
ext/Time-HiRes/Changes Time::HiRes extension
ext/Time-HiRes/fallback/const-c.inc Time::HiRes extension
ext/Time-HiRes/fallback/const-xs.inc Time::HiRes extension
lib/Tie/Handle/stdhandle.t Test for Tie::StdHandle
lib/Tie/Hash/NamedCapture.pm Implements %- and %+ behaviour
lib/Tie/Hash.pm Base class for tied hashes
-lib/Tie/Memoize.pm Base class for memoized tied hashes
-lib/Tie/Memoize.t Test for Memoize.t
lib/Tie/RefHash.pm Base class for tied hashes with references as keys
lib/Tie/RefHash/rebless.t Test for Tie::RefHash with rebless
lib/Tie/RefHash/refhash.t Test for Tie::RefHash and Tie::RefHash::Nestable
#!./perl -w
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
-}
-
use strict;
use Tie::Memoize;
-use Test::More tests => 28;
+use Test::More tests => 27;
use File::Spec;
sub slurp {
}
sub exists { my ($key, $dir) = @_; return -f File::Spec->catfile($dir, $key) }
-my $directory = File::Spec->catdir(File::Spec->updir, 'lib');
+chdir(File::Spec->updir()) if not -d 't';
+
+my $directory = File::Spec->catdir('lib', 'Tie');
tie my %hash, 'Tie::Memoize', \&slurp, $directory, \&exists,
{ fake_file1 => 123, fake_file2 => 45678 },
ok(not defined $hash{known_to_exist});
ok(not exists $hash{known_to_exist});
ok(not exists $hash{'strict.pm'});
-my $c = slurp('constant.pm', $directory);
+my $c = slurp('Memoize.pm', $directory);
ok($c);
-ok($hash{'constant.pm'} eq $c);
-ok($hash{'constant.pm'} eq $c);
+ok($hash{'Memoize.pm'} eq $c);
+ok($hash{'Memoize.pm'} eq $c);
ok(not exists $hash{'strict.pm'});
ok(exists $hash{'blib.pm'});
tie %hash, 'Tie::Memoize', \&slurp, $directory;
-ok(exists $hash{'strict.pm'}, 'existing file');
+ok(exists $hash{'Memoize.pm'}, 'existing file');
ok(not exists $hash{fake_file2});
ok(not exists $hash{fake_file1});
ok(not exists $hash{known_to_exist});
-ok(exists $hash{'strict.pm'}, 'existing file again');
+ok(exists $hash{'Memoize.pm'}, 'existing file again');
ok(not defined $hash{fake_file3});
ok(not defined $hash{known_to_exist});
ok(not exists $hash{known_to_exist});
-ok(exists $hash{'strict.pm'}, 'existing file again');
-ok($hash{'constant.pm'} eq $c);
-ok($hash{'constant.pm'} eq $c);
-ok(exists $hash{'strict.pm'}, 'existing file again');
-ok(exists $hash{'blib.pm'}, 'another existing file');
+ok(exists $hash{'Memoize.pm'}, 'existing file again');
+ok($hash{'Memoize.pm'} eq $c);
+ok($hash{'Memoize.pm'} eq $c);
+ok(exists $hash{'Memoize.pm'}, 'existing file again');