Add core test boilerplates
[p5sagit/p5-mst-13.2.git] / lib / FileCache / t / 01open.t
CommitLineData
1673d79e 1#!./perl
304efdcb 2
3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 chdir 't' if -d 't';
6 @INC = qw(../lib);
7 }
8}
9
1673d79e 10use FileCache;
11use vars qw(@files);
12BEGIN {
42bff5bd 13 @files = qw(foo bar baz quux Foo_Bar);
1673d79e 14 chdir 't' if -d 't';
15
16 #For tests within the perl distribution
17 @INC = '../lib' if -d '../lib';
18 END;
19}
20END{
98a392ec 21 1 while unlink @files;
1673d79e 22}
23
24
25print "1..1\n";
26
27{# Test 1: that we can open files
28 for my $path ( @files ){
29 cacheout $path;
30 print $path "$path 1\n";
846e3505 31 close $path;
1673d79e 32 }
33 print "not " unless scalar map({ -f } @files) == scalar @files;
34 print "ok 1\n";
35}