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