Thread::Semaphore 2.07
[p5sagit/p5-mst-13.2.git] / lib / Thread / Semaphore / t / 03_nothreads.t
1 use strict;
2 use warnings;
3
4 BEGIN {
5     if ($ENV{'PERL_CORE'}){
6         chdir('t');
7         unshift(@INC, '../lib');
8     }
9 }
10
11 use Test::More 'tests' => 4;
12
13 use Thread::Semaphore;
14
15 my $s = Thread::Semaphore->new();
16 is($$s, 1, 'Non-threaded semaphore');
17 $s->down();
18 is($$s, 0, 'Non-threaded semaphore');
19 $s->up(2);
20 is($$s, 2, 'Non-threaded semaphore');
21 $s->down();
22 is($$s, 1, 'Non-threaded semaphore');
23
24 # EOF