This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
bump base.pm $VERSION and un-CUSTOMISE
[perl5.git] / ext / FileCache / t / 02maxopen.t
CommitLineData
1673d79e 1#!./perl
304efdcb 2
d9268716 3use FileCache maxopen => 2;
1673d79e 4use vars qw(@files);
d9268716
S
5BEGIN { @files = qw(foo bar baz quux) }
6END { 1 while unlink @files }
1673d79e 7
d9268716 8use Test::More tests => 5;
1673d79e
JH
9
10{# Test 2: that we actually adhere to maxopen
11 for my $path ( @files ){
12 cacheout $path;
13 print $path "$path 1\n";
14 }
15
16 my @cat;
17 for my $path ( @files ){
18 ok(fileno($path) || $path =~ /^(?:foo|bar)$/);
19 next unless fileno($path);
20 print $path "$path 2\n";
21 close($path);
1ae6ead9 22 open($path, '<', $path);
1673d79e
JH
23 <$path>;
24 push @cat, <$path>;
25 close($path);
26 }
27 ok( grep(/^(?:baz|quux) 2$/, @cat) == 2 );
28}