Fix up .gitignore files some more
[p5sagit/p5-mst-13.2.git] / ext / Storable / t / tied.t
index 88131fe..662d9ae 100644 (file)
@@ -1,34 +1,31 @@
 #!./perl
-
-# $Id: tied.t,v 1.0 2000/09/01 19:40:42 ram Exp $
 #
 #  Copyright (c) 1995-2000, Raphael Manfredi
 #  
 #  You may redistribute only under the same terms as Perl 5, as specified
 #  in the README file that comes with the distribution.
 #
-# $Log: tied.t,v $
-# Revision 1.0  2000/09/01 19:40:42  ram
-# Baseline for first official release.
-#
 
 sub BEGIN {
-    chdir('t') if -d 't';
-    @INC = '.'; 
-    push @INC, '../lib';
+    if ($ENV{PERL_CORE}){
+       chdir('t') if -d 't';
+       @INC = ('.', '../lib', '../ext/Storable/t');
+    } else {
+       unshift @INC, 't';
+    }
     require Config; import Config;
-    if ($Config{'extensions'} !~ /\bStorable\b/) {
+    if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
         print "1..0 # Skip: Storable was not built\n";
         exit 0;
     }
-    require 'lib/st-dump.pl';
+    require 'st-dump.pl';
 }
 
 sub ok;
 
 use Storable qw(freeze thaw);
 
-print "1..22\n";
+print "1..23\n";
 
 ($scalar_fetch, $array_fetch, $hash_fetch) = (0, 0, 0);
 
@@ -211,3 +208,13 @@ ok 20, defined $ht;
 ok 21, $ht->{'x'} == 1;
 ok 22, $FAULT::fault == 2;
 
+{
+    package P;
+    use Storable qw(freeze thaw);
+    use vars qw($a $b);
+    $b = "not ok ";
+    sub TIESCALAR { bless \$a } sub FETCH { "ok " }
+    tie $a, P; my $r = thaw freeze \$a; $b = $$r;
+    print $b , 23, "\n";
+}
+