ext/Fcntl/t/fcntl.t See if Fcntl works
ext/Fcntl/t/mode.t See if S_ISREG() and S_ISDIR() work
ext/Fcntl/t/syslfs.t See if large files work for sysio
+ext/FileCache/lib/FileCache.pm Keep more files open than the system permits
+ext/FileCache/t/01open.t See if FileCache works
+ext/FileCache/t/02maxopen.t See if FileCache works
+ext/FileCache/t/03append.t See if FileCache works
+ext/FileCache/t/04twoarg.t See if FileCache works
+ext/FileCache/t/05override.t See if FileCache works
+ext/FileCache/t/06export.t See if FileCache exporting works
+ext/FileCache/t/07noimport.t See if FileCache works without importing
ext/File-Fetch/lib/File/Fetch.pm File::Fetch
ext/File-Fetch/t/01_File-Fetch.t File::Fetch tests
ext/File-Glob/bsd_glob.c File::Glob extension run time code
lib/feature.t See if features work
lib/File/Basename.pm Emulate the basename program
lib/File/Basename.t See if File::Basename works
-lib/FileCache.pm Keep more files open than the system permits
-lib/FileCache/t/01open.t See if FileCache works
-lib/FileCache/t/02maxopen.t See if FileCache works
-lib/FileCache/t/03append.t See if FileCache works
-lib/FileCache/t/04twoarg.t See if FileCache works
-lib/FileCache/t/05override.t See if FileCache works
-lib/FileCache/t/06export.t See if FileCache exporting works
-lib/FileCache/t/07noimport.t See if FileCache works without importing
lib/File/CheckTree.pm Perl module supporting wholesale file mode validation
lib/File/CheckTree.t See if File::CheckTree works
lib/File/Compare.pm Emulation of cmp command
ext/Errno
ext/Fcntl/
ext/File-Glob/
+ ext/FileCache/lib
+ ext/FileCache/t
ext/GDBM_File/
ext/Hash-Util-FieldHash/
ext/Hash-Util/
lib/File/Find.pm
lib/File/Find/
lib/File/stat.{pm,t}
- lib/FileCache.pm
- lib/FileCache/
lib/FileHandle.{pm,t}
lib/FindBin.{pm,t}
lib/Getopt/Std.{pm,t}
/B-Deparse/Makefile.PL
/B-Lint/Makefile.PL
/Data-Dumper/Makefile.PL
+/FileCache/Makefile.PL
/File-Fetch/Makefile.PL
/Filter-Simple/Makefile.PL
/Filter-Util-Call/Makefile.PL
--- /dev/null
+#!./perl
+
+use FileCache;
+
+use vars qw(@files);
+BEGIN { @files = qw(foo bar baz quux Foo_Bar) }
+END { 1 while unlink @files }
+
+use Test::More tests => 1;
+
+{# Test 1: that we can open files
+ for my $path ( @files ){
+ cacheout $path;
+ print $path "$path 1\n";
+ close $path;
+ }
+ ok(scalar(map { -f } @files) == scalar(@files));
+}
#!./perl
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = qw(../lib);
- }
-}
-
-use FileCache maxopen=>2;
-use Test;
+use FileCache maxopen => 2;
use vars qw(@files);
-BEGIN {
- @files = qw(foo bar baz quux);
- chdir 't' if -d 't';
+BEGIN { @files = qw(foo bar baz quux) }
+END { 1 while unlink @files }
- #For tests within the perl distribution
- @INC = '../lib' if -d '../lib';
- END;
- plan tests=>5;
-}
-END{
- 1 while unlink @files;
-}
+use Test::More tests => 5;
{# Test 2: that we actually adhere to maxopen
for my $path ( @files ){
#!./perl
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = qw(../lib);
- }
-}
-
-use FileCache maxopen=>2;
+use FileCache maxopen => 2;
use vars qw(@files);
-BEGIN {
- @files = qw(foo bar baz quux Foo_Bar);
- chdir 't' if -d 't';
+BEGIN { @files = qw(foo bar baz quux Foo_Bar) }
+END { 1 while unlink @files }
- #For tests within the perl distribution
- @INC = '../lib' if -d '../lib';
- END;
-}
-END{
- 1 while unlink @files;
-}
-
-print "1..2\n";
+use Test::More tests => 2;
{# Test 3: that we open for append on second viewing
my @cat;
push @cat, do{ local $/; <$path>};
close($path);
}
- print 'not ' unless scalar grep(/\b3$/m, @cat) == scalar @files;
- print "ok 1\n";
+
+ ok(scalar(grep/\b3$/m, @cat) == scalar(@files));
+
@cat = ();
for my $path ( @files ){
cacheout $path;
push @cat, do{ local $/; <$path>};
close($path);
}
- print 'not ' unless scalar grep(/\b33$/m, @cat) == scalar @files;
- print "ok 2\n";
+ ok(scalar(grep /\b33$/m, @cat) == scalar(@files));
}
#!./perl
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = qw(../lib);
- }
-}
-
use FileCache;
-END{
- unlink('foo');
-}
+END { unlink('foo') }
-print "1..1\n";
+use Test::More tests => 1;
{# Test 4: that 2 arg format works, and that we cycle on mode change
cacheout '>', "foo";
cacheout '+>', "foo";
print foo "foo 44\n";
seek(foo, 0, 0);
- print 'not ' unless <foo> eq "foo 44\n";
- print "ok 1\n";
+ ok(<foo> eq "foo 44\n");
close foo;
}
--- /dev/null
+#!./perl
+
+use FileCache;
+
+END { unlink("Foo_Bar") }
+
+use Test::More tests => 1;
+
+{# Test 5: that close is overridden properly within the caller
+ cacheout local $_ = "Foo_Bar";
+ print $_ "Hello World\n";
+ close($_);
+ ok(!fileno($_));
+}
--- /dev/null
+#!./perl
+use vars qw(@funcs $i);
+
+BEGIN {
+ # Functions exported by FileCache;
+ @funcs = qw[cacheout cacheout_close];
+ $i = 0;
+}
+
+use Test::More tests => 8;
+
+# Test 6: Test that exporting both works to package main and
+# other packages. Now using Exporter.
+
+# First, we shouldn't be able to have these in our namespace
+# Add them to BEGIN so the later 'use' doesn't influence this
+# test
+BEGIN {
+ ok(not __PACKAGE__->can($_)) foreach @funcs;
+}
+
+# With an empty import list, we also shouldn't have them in
+# our namespace.
+# Add them to BEGIN so the later 'use' doesn't influence this
+# test
+BEGIN {
+ use FileCache ();
+ ok(not __PACKAGE__->can($_)) foreach @funcs;
+}
+
+
+# Now, we use FileCache in 'main'
+{
+ use FileCache;
+ ok(__PACKAGE__->can($_)) foreach @funcs;
+}
+
+# Now we use them in another package
+{
+ package X;
+ use FileCache;
+ ::ok(__PACKAGE__->can($_)) foreach @main::funcs;
+}
+
#!./perl -w
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = qw(../lib);
- }
-}
-
-require './test.pl';
-plan( tests => 1 );
+use Test::More tests => 1;
# Try using FileCache without importing to make sure everything's
# initialized without it.
/Errno.pm
/ExtUtils/Miniperl.pm
/Fcntl.pm
+/FileCache.pm
/File/Fetch.pm
/File/Glob.pm
/File/GlobMapper.pm
+++ /dev/null
-#!./perl
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = qw(../lib);
- }
-}
-
-use FileCache;
-use vars qw(@files);
-BEGIN {
- @files = qw(foo bar baz quux Foo_Bar);
- chdir 't' if -d 't';
-
- #For tests within the perl distribution
- @INC = '../lib' if -d '../lib';
- END;
-}
-END{
- 1 while unlink @files;
-}
-
-
-print "1..1\n";
-
-{# Test 1: that we can open files
- for my $path ( @files ){
- cacheout $path;
- print $path "$path 1\n";
- close $path;
- }
- print "not " unless scalar map({ -f } @files) == scalar @files;
- print "ok 1\n";
-}
+++ /dev/null
-#!./perl
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = qw(../lib);
- }
-}
-
-use FileCache;
-
-END{
- unlink("Foo_Bar");
-}
-print "1..1\n";
-
-{# Test 5: that close is overridden properly within the caller
- cacheout local $_ = "Foo_Bar";
- print $_ "Hello World\n";
- close($_);
- print 'not ' if fileno($_);
- print "ok 1\n";
-}
+++ /dev/null
-#!./perl
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = qw(../lib);
- }
-}
-
-BEGIN {
- # Functions exported by FileCache;
- @funcs = qw[cacheout cacheout_close];
- $i = 0;
-
- # number of tests
- print "1..8\n";
-}
-
-# Test 6: Test that exporting both works to package main and
-# other packages. Now using Exporter.
-
-# First, we shouldn't be able to have these in our namespace
-# Add them to BEGIN so the later 'use' doesn't influence this
-# test
-BEGIN {
- for my $f (@funcs) {
- ++$i;
- print 'not ' if __PACKAGE__->can($f);
- print "ok $i\n";
- }
-}
-
-# With an empty import list, we also shouldn't have them in
-# our namespace.
-# Add them to BEGIN so the later 'use' doesn't influence this
-# test
-BEGIN {
- use FileCache ();
- for my $f (@funcs) {
- ++$i;
- print 'not ' if __PACKAGE__->can($f);
- print "ok $i\n";
- }
-}
-
-
-# Now, we use FileCache in 'main'
-{ use FileCache;
- for my $f (@funcs) {
- ++$i;
- print 'not ' if !__PACKAGE__->can($f);
- print "ok $i\n";
- }
-}
-
-# Now we use them in another package
-{ package X;
- use FileCache;
- for my $f (@main::funcs) {
- ++$main::i;
- print 'not ' if !__PACKAGE__->can($f);
- print "ok $main::i\n";
- }
-}