diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-07-27 16:03:21 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-07-27 16:03:21 +0200 |
commit | 304efdcbf5a203c3e0f6c6f0db51fdcdf250aca1 (patch) | |
tree | fef1bc6cdc7213d0f78bab08962e2a0175d642e3 /lib/FileCache | |
parent | 8e2e2108bd3e781e0030bedb33fdf9102a8de1c7 (diff) | |
download | perl-304efdcbf5a203c3e0f6c6f0db51fdcdf250aca1.tar.gz |
Add core test boilerplates
(this is not a dual-life module)
Diffstat (limited to 'lib/FileCache')
-rw-r--r-- | lib/FileCache/t/01open.t | 8 | ||||
-rw-r--r-- | lib/FileCache/t/02maxopen.t | 8 | ||||
-rw-r--r-- | lib/FileCache/t/03append.t | 8 | ||||
-rw-r--r-- | lib/FileCache/t/04twoarg.t | 14 | ||||
-rw-r--r-- | lib/FileCache/t/05override.t | 14 | ||||
-rw-r--r-- | lib/FileCache/t/06export.t | 12 | ||||
-rw-r--r-- | lib/FileCache/t/07noimport.t | 6 |
7 files changed, 51 insertions, 19 deletions
diff --git a/lib/FileCache/t/01open.t b/lib/FileCache/t/01open.t index 75da3b28d4..ee207ddf93 100644 --- a/lib/FileCache/t/01open.t +++ b/lib/FileCache/t/01open.t @@ -1,4 +1,12 @@ #!./perl + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = qw(../lib); + } +} + use FileCache; use vars qw(@files); BEGIN { diff --git a/lib/FileCache/t/02maxopen.t b/lib/FileCache/t/02maxopen.t index 603edebc7f..2f737eb1c8 100644 --- a/lib/FileCache/t/02maxopen.t +++ b/lib/FileCache/t/02maxopen.t @@ -1,4 +1,12 @@ #!./perl + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = qw(../lib); + } +} + use FileCache maxopen=>2; use Test; use vars qw(@files); diff --git a/lib/FileCache/t/03append.t b/lib/FileCache/t/03append.t index a6ba6f3aac..5afc513eb6 100644 --- a/lib/FileCache/t/03append.t +++ b/lib/FileCache/t/03append.t @@ -1,4 +1,12 @@ #!./perl + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = qw(../lib); + } +} + use FileCache maxopen=>2; use vars qw(@files); BEGIN { diff --git a/lib/FileCache/t/04twoarg.t b/lib/FileCache/t/04twoarg.t index 66da9719a2..40bae6dcbf 100644 --- a/lib/FileCache/t/04twoarg.t +++ b/lib/FileCache/t/04twoarg.t @@ -1,12 +1,14 @@ #!./perl -BEGIN { - use FileCache; - chdir 't' if -d 't'; - #For tests within the perl distribution - @INC = '../lib' if -d '../lib'; - END; +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = qw(../lib); + } } + +use FileCache; + END{ unlink('foo'); } diff --git a/lib/FileCache/t/05override.t b/lib/FileCache/t/05override.t index a807c25640..b7b4083433 100644 --- a/lib/FileCache/t/05override.t +++ b/lib/FileCache/t/05override.t @@ -1,12 +1,14 @@ #!./perl -BEGIN { - use FileCache; - chdir 't' if -d 't'; - #For tests within the perl distribution - @INC = '../lib' if -d '../lib'; - END; +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = qw(../lib); + } } + +use FileCache; + END{ unlink("Foo_Bar"); } diff --git a/lib/FileCache/t/06export.t b/lib/FileCache/t/06export.t index 60f55a3182..67d5996e74 100644 --- a/lib/FileCache/t/06export.t +++ b/lib/FileCache/t/06export.t @@ -1,11 +1,13 @@ #!./perl -BEGIN { - chdir 't' if -d 't'; - #For tests within the perl distribution - @INC = '../lib' if -d '../lib'; - END; +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; diff --git a/lib/FileCache/t/07noimport.t b/lib/FileCache/t/07noimport.t index d2f926ce5c..a6e024d002 100644 --- a/lib/FileCache/t/07noimport.t +++ b/lib/FileCache/t/07noimport.t @@ -1,8 +1,10 @@ #!./perl -w BEGIN { - chdir 't'; - @INC = '../lib'; + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = qw(../lib); + } } require './test.pl'; |