3
# $Id: simple.t,v 0.2.1.1 2000/08/15 18:37:45 ram Exp $
5
# Copyright (c) 1998-1999, 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.
11
# Revision 0.2.1.1 2000/08/15 18:37:45 ram
12
# patch3: forgot to remove "t.mark"
14
# Revision 0.2 1999/12/07 20:51:05 ram
15
# Baseline for 0.2 release.
20
$| = 1; # We're going to fork
24
# Basic tests made via the OO interface.
27
my $manager = LockFile::Simple->make;
31
my $lock = $manager->lock('t');
33
print "not " unless ref $lock;
36
print "not " unless -r 't.lock';
39
print "not " if $manager->trylock('t');
42
print "not " unless $manager->unlock('t');
45
print "not " if -f 't.lock';
53
my ($msg) = join(' ', @_);
54
open(MARK, ">t.mark");
59
$manager = LockFile::Simple->make(-autoclean => 1, -wfunc => \&mark);
70
print "not " unless -r 't.mark';