3 # $Id: lock.t,v 1.0.1.4 2001/01/03 09:41:00 ram Exp $
8 # Revision 1.0.1.4 2001/01/03 09:41:00 ram
9 # patch7: use new CAN_FLOCK routine to determine whether to run tests
11 # Revision 1.0.1.3 2000/10/26 17:11:27 ram
12 # patch5: just check $^O, there's no need for the whole Config
14 # Revision 1.0.1.2 2000/10/23 18:03:07 ram
15 # patch4: protected calls to flock() for dos platform
17 # Revision 1.0.1.1 2000/09/28 21:44:06 ram
25 @INC = ('.', '../lib', '../ext/Storable/t');
29 require Config; import Config;
30 if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
31 print "1..0 # Skip: Storable was not built\n";
40 use Storable qw(lock_store lock_retrieve);
42 unless (&Storable::CAN_FLOCK) {
43 print "1..0 # Skip: fcntl/flock emulation broken on this platform\n";
49 @a = ('first', undef, 3, -4, -3.14159, 456, 4.5);
52 # We're just ensuring things work, we're not validating locking.
55 ok 1, defined lock_store(\@a, 'store');
56 ok 2, $dumped = &dump(\@a);
58 $root = lock_retrieve('store');
59 ok 3, ref $root eq 'ARRAY';
61 ok 5, &dump($root) eq $dumped;