diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2021-10-15 15:41:29 +0300 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2021-10-18 14:22:21 +1100 |
commit | 2fb69afd11f0d2b487eaeb5b057e20b86053fd34 (patch) | |
tree | f2aad35fd49e5bf021dec3283df669668cfc4d48 /cpan/Memoize | |
parent | c2ad6dafc59d8d9369dce3e7a16dfe04c43872ef (diff) | |
download | perl-2fb69afd11f0d2b487eaeb5b057e20b86053fd34.tar.gz |
Fix Memoize tests, where GDBM_File is involved
* cpan/Memoize/t/errors.t: Use GDBM_NEWDB as the flags argument
when tying to GDBM_File.
* cpan/Memoize/t/tie_gdbm.t: Likewise.
Diffstat (limited to 'cpan/Memoize')
-rw-r--r-- | cpan/Memoize/t/errors.t | 4 | ||||
-rw-r--r-- | cpan/Memoize/t/tie_gdbm.t | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/cpan/Memoize/t/errors.t b/cpan/Memoize/t/errors.t index 43e77b910c..90bc29826b 100644 --- a/cpan/Memoize/t/errors.t +++ b/cpan/Memoize/t/errors.t @@ -21,7 +21,7 @@ $n = 4; my $dummyfile = './dummydb'; use Fcntl; my %args = ( DB_File => [], - GDBM_File => [$dummyfile, 2, 0666], + GDBM_File => [$dummyfile, \&GDBM_File::GDBM_NEWDB, 0666], ODBM_File => [$dummyfile, O_RDWR|O_CREAT, 0666], NDBM_File => [$dummyfile, O_RDWR|O_CREAT, 0666], SDBM_File => [$dummyfile, O_RDWR|O_CREAT, 0666], @@ -29,7 +29,7 @@ my %args = ( DB_File => [], for $mod (qw(DB_File GDBM_File SDBM_File ODBM_File NDBM_File)) { eval { require "$mod.pm"; - tie my %cache => $mod, @{$args{$mod}}; + tie my %cache => $mod, map { (ref($_) eq 'CODE') ? &$_ : $_ } @{$args{$mod}}; memoize(sub {}, LIST_CACHE => [HASH => \%cache ]); }; print $@ =~ /can only store scalars/ diff --git a/cpan/Memoize/t/tie_gdbm.t b/cpan/Memoize/t/tie_gdbm.t index 002ab9de00..8d55647b01 100644 --- a/cpan/Memoize/t/tie_gdbm.t +++ b/cpan/Memoize/t/tie_gdbm.t @@ -35,7 +35,7 @@ sub tryout { require GDBM_File; my ($tiepack, $file, $testno) = @_; - tie my %cache => $tiepack, $file, O_RDWR | O_CREAT, 0666 + tie my %cache => $tiepack, $file, &GDBM_File::GDBM_NEWDB, 0666 or die $!; memoize 'c5', |