3 # $Id: retrieve.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.
10 # $Log: retrieve.t,v $
11 # Revision 0.7 2000/08/03 22:04:45 ram
12 # Baseline for second beta release.
17 unshift @INC, '../lib';
18 require Config; import Config;
19 if ($Config{'extensions'} !~ /\bStorable\b/) {
20 print "1..0 # Skip: Storable was not built\n";
23 require 'lib/st-dump.pl';
27 use Storable qw(store retrieve nstore);
34 $c->{attribute} = 'attrval';
35 %a = ('key', 'value', 1, 0, $a, $b, 'cvar', \$c);
36 @a = ('first', '', undef, 3, -4, -3.14159, 456, 4.5,
37 $b, \$a, $a, $c, \$c, \%a);
39 print "not " unless defined store(\@a, 'store');
41 print "not " if Storable::last_op_in_netorder();
43 print "not " unless defined nstore(\@a, 'nstore');
45 print "not " unless Storable::last_op_in_netorder();
47 print "not " unless Storable::last_op_in_netorder();
50 $root = retrieve('store');
51 print "not " unless defined $root;
53 print "not " if Storable::last_op_in_netorder();
56 $nroot = retrieve('nstore');
57 print "not " unless defined $nroot;
59 print "not " unless Storable::last_op_in_netorder();
67 print "not " unless $d1 eq $d2;
70 # Make sure empty string is defined at retrieval time
71 print "not " unless defined $root->[1];
73 print "not " if length $root->[1];
76 END { 1 while unlink('store', 'nstore') }