7 unless ($Config{extensions} =~ /\bNDBM_File\b/) {
8 print "1..0 # Skip: no NDBM_File\n";
13 use Memoize 0.45 qw(memoize unmemoize);
15 # use Memoize::NDBM_File;
16 # $Memoize::NDBM_File::Verbose = 0;
32 eval {require Memoize::NDBM_File};
41 if (eval {require File::Spec::Functions}) {
42 File::Spec::Functions->import();
44 *catfile = sub { join '/', @_ };
46 $tmpdir = $ENV{TMP} || $ENV{TMPDIR} || '/tmp';
47 $file = catfile($tmpdir, "md$$");
48 unlink $file, "$file.dir", "$file.pag";
49 tryout('Memoize::NDBM_File', $file, 1); # Test 1..4
50 unlink $file, "$file.dir", "$file.pag";
53 my ($tiepack, $file, $testno) = @_;
57 SCALAR_CACHE => ['TIE', $tiepack, $file, O_RDWR | O_CREAT, 0666],
63 print (($t1 == 5) ? "ok $testno\n" : "not ok $testno\n");
65 print (($t2 == 5) ? "ok $testno\n" : "not ok $testno\n");
68 # Now something tricky---we'll memoize c23 with the wrong table that
69 # has the 5 already cached.
71 SCALAR_CACHE => ['TIE', $tiepack, $file, O_RDWR, 0666],
78 print (($t3 == 5) ? "ok $testno\n" : "not ok $testno\n");
80 print (($t4 == 5) ? "ok $testno\n" : "not ok $testno\n");