diff options
Diffstat (limited to 'dist/Thread-Semaphore/t/03_nothreads.t')
-rw-r--r-- | dist/Thread-Semaphore/t/03_nothreads.t | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/dist/Thread-Semaphore/t/03_nothreads.t b/dist/Thread-Semaphore/t/03_nothreads.t new file mode 100644 index 0000000000..58bcb04987 --- /dev/null +++ b/dist/Thread-Semaphore/t/03_nothreads.t @@ -0,0 +1,26 @@ +use strict; +use warnings; + +BEGIN { + if ($ENV{'PERL_CORE'}){ + chdir('t'); + unshift(@INC, '../lib'); + } +} + +use Test::More 'tests' => 4; + +use Thread::Semaphore; + +my $s = Thread::Semaphore->new(); +is($$s, 1, 'Non-threaded semaphore'); +$s->down(); +is($$s, 0, 'Non-threaded semaphore'); +$s->up(2); +is($$s, 2, 'Non-threaded semaphore'); +$s->down(); +is($$s, 1, 'Non-threaded semaphore'); + +exit(0); + +# EOF |