Portability tweak on #7377.
[p5sagit/p5-mst-13.2.git] / t / lib / st-lock.t
CommitLineData
dd19458b 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
13sub 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 }
e4dfc136 22 if (!$Config{'d_flock'} && !$Config{'d_fcntl'} && !$Config{'d_lockf'}) {
23 print "1..0 # Skip: no flock or flock emulation on this platform\n";
24 exit 0;
25 }
dd19458b 26 require 'lib/st-dump.pl';
27}
28
29sub ok;
30
31use Storable qw(lock_store lock_retrieve);
32
33print "1..5\n";
34
35@a = ('first', undef, 3, -4, -3.14159, 456, 4.5);
36
37#
38# We're just ensuring things work, we're not validating locking.
39#
40
41ok 1, defined lock_store(\@a, 'store');
42ok 2, $dumped = &dump(\@a);
43
44$root = lock_retrieve('store');
45ok 3, ref $root eq 'ARRAY';
46ok 4, @a == @$root;
47ok 5, &dump($root) eq $dumped;
48
49unlink 't/store';
50