3 # $Id: lock.t,v 1.0.1.4 2001/01/03 09:41:00 ram Exp $
5 # Copyright (c) 1995-2000, Raphael Manfredi
7 # You may redistribute only under the same terms as Perl 5, as specified
8 # in the README file that comes with the distribution.
14 @INC = ('.', '../lib', '../ext/Storable/t');
18 require Config; import Config;
19 if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
20 print "1..0 # Skip: Storable was not built\n";
29 use Storable qw(lock_store lock_retrieve);
31 unless (&Storable::CAN_FLOCK) {
32 print "1..0 # Skip: fcntl/flock emulation broken on this platform\n";
38 @a = ('first', undef, 3, -4, -3.14159, 456, 4.5);
41 # We're just ensuring things work, we're not validating locking.
44 ok 1, defined lock_store(\@a, 'store');
45 ok 2, $dumped = &dump(\@a);
47 $root = lock_retrieve('store');
48 ok 3, ref $root eq 'ARRAY';
50 ok 5, &dump($root) eq $dumped;