Upgrade to Storable 1.0.3, from Raphael Manfredi.
[p5sagit/p5-mst-13.2.git] / t / lib / st-lock.t
1 #!./perl
2
3 # $Id: lock.t,v 1.0.1.1 2000/09/28 21:44:06 ram Exp $
4 #
5 #  @COPYRIGHT@
6 #
7 # $Log: lock.t,v $
8 # Revision 1.0.1.1  2000/09/28 21:44:06  ram
9 # patch2: created.
10 #
11 #
12
13 sub BEGIN {
14     chdir('t') if -d 't';
15     @INC = '.'; 
16     push @INC, '../lib';
17     require Config; import Config;
18     if ($Config{'extensions'} !~ /\bStorable\b/) {
19         print "1..0 # Skip: Storable was not built\n";
20         exit 0;
21     }
22     require 'lib/st-dump.pl';
23 }
24
25 sub ok;
26
27 use Storable qw(lock_store lock_retrieve);
28
29 print "1..5\n";
30
31 @a = ('first', undef, 3, -4, -3.14159, 456, 4.5);
32
33 #
34 # We're just ensuring things work, we're not validating locking.
35 #
36
37 ok 1, defined lock_store(\@a, 'store');
38 ok 2, $dumped = &dump(\@a);
39
40 $root = lock_retrieve('store');
41 ok 3, ref $root eq 'ARRAY';
42 ok 4, @a == @$root;
43 ok 5, &dump($root) eq $dumped; 
44
45 unlink 't/store';
46