82dee7de92a0bd35 failed to add ext/lib/Makefile.PL. Oops.
[p5sagit/p5-mst-13.2.git] / ext / 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 exit(0);
25
26 # EOF