3 # $Id: freeze.t,v 0.7 2000/08/03 22:04:45 ram Exp $
5 # Copyright (c) 1995-2000, Raphael Manfredi
7 # You may redistribute only under the terms of the Artistic License,
8 # as specified in the README file that comes with the distribution.
11 # Revision 0.7 2000/08/03 22:04:45 ram
12 # Baseline for second beta release.
17 unshift @INC, '../lib';
18 require 'lib/st-dump.pl';
22 use Storable qw(freeze nfreeze thaw);
34 %a = ('key', 'value', 1, 0, $a, $b, 'cvar', \$c);
35 @a = ('first', undef, 3, -4, -3.14159, 456, 4.5, $d, \$d, \$e, $e,
36 $b, \$a, $a, $c, \$c, \%a);
38 print "not " unless defined ($f1 = freeze(\@a));
45 print "not " unless defined $root;
51 print "not " unless $got eq $dumped;
54 package FOO; @ISA = qw(Storable);
58 $self->{key} = \%main::a;
65 print "not " unless $f2 = $foo->freeze;
68 print "not " unless $f3 = $foo->nfreeze;
72 print "not " unless defined $root3;
75 print "not " unless &dump($foo) eq &dump($root3);
79 print "not " unless &dump($foo) eq &dump($root);
82 print "not " unless &dump($root3) eq &dump($root);
85 $other = freeze($root);
86 print "not " unless length($other) == length($f2);
89 $root2 = thaw($other);
90 print "not " unless &dump($root2) eq &dump($root);
97 'SELECT table_name, table_owner, num_rows FROM iitables
98 where table_owner != \'$ingres\' and table_owner != \'DBA\''
103 print "not " unless $VAR2->[3] eq $VAR1->[3];
106 # Test the workaround for LVALUE bug in perl 5.004_04 -- from Gisle Aas
107 sub foo { $_[0] = 1 }
110 eval { freeze($foo) };