Add core test boilerplates
[p5sagit/p5-mst-13.2.git] / lib / FileCache / t / 01open.t
1 #!./perl
2
3 BEGIN {
4    if( $ENV{PERL_CORE} ) {
5         chdir 't' if -d 't';
6         @INC = qw(../lib);
7     }
8 }
9
10 use FileCache;
11 use vars qw(@files);
12 BEGIN {
13     @files = qw(foo bar baz quux Foo_Bar);
14     chdir 't' if -d 't';
15
16     #For tests within the perl distribution
17     @INC = '../lib' if -d '../lib';
18     END;
19 }
20 END{
21   1 while unlink @files;
22 }
23
24
25 print "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";
31          close $path;
32      }
33      print "not " unless scalar map({ -f } @files) == scalar @files;
34      print "ok 1\n";
35 }