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 'lib/st-dump.pl';
22 use Storable qw(store retrieve nstore);
29 $c->{attribute} = 'attrval';
30 %a = ('key', 'value', 1, 0, $a, $b, 'cvar', \$c);
31 @a = ('first', '', undef, 3, -4, -3.14159, 456, 4.5,
32 $b, \$a, $a, $c, \$c, \%a);
34 print "not " unless defined store(\@a, 'store');
36 print "not " if Storable::last_op_in_netorder();
38 print "not " unless defined nstore(\@a, 'nstore');
40 print "not " unless Storable::last_op_in_netorder();
42 print "not " unless Storable::last_op_in_netorder();
45 $root = retrieve('store');
46 print "not " unless defined $root;
48 print "not " if Storable::last_op_in_netorder();
51 $nroot = retrieve('nstore');
52 print "not " unless defined $nroot;
54 print "not " unless Storable::last_op_in_netorder();
62 print "not " unless $d1 eq $d2;
65 # Make sure empty string is defined at retrieval time
66 print "not " unless defined $root->[1];
68 print "not " if length $root->[1];
71 END { unlink 'store', 'nstore' }