Skip to content

Thread::Queue: clean up some tests #23121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions dist/Thread-Queue/t/01_basic.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use strict;
use warnings;

use Config;
BEGIN {
use Config;
if (! $Config{'useithreads'}) {
print("1..0 # SKIP Perl not compiled with 'useithreads'\n");
exit(0);
Expand All @@ -11,16 +11,7 @@ BEGIN {

use threads;
use Thread::Queue;

BEGIN { # perl RT 133382
if ($] == 5.008) {
require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
Test::More->import();
} # end BEGIN
plan('tests' => 81);
use Test::More 'tests' => 81;

### Basic usage with multiple threads ###

Expand Down
13 changes: 2 additions & 11 deletions dist/Thread-Queue/t/02_refs.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use strict;
use warnings;

use Config;
BEGIN {
use Config;
if (! $Config{'useithreads'}) {
print("1..0 # SKIP Perl not compiled with 'useithreads'\n");
exit(0);
Expand All @@ -12,16 +12,7 @@ BEGIN {
use threads;
use threads::shared;
use Thread::Queue;

BEGIN { # perl RT 133382
if ($] == 5.008) {
require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
Test::More->import();
} # end BEGIN
plan('tests' => 46);
use Test::More 'tests' => 46;

# Regular array
my @ary1 = qw/foo bar baz/;
Expand Down
13 changes: 2 additions & 11 deletions dist/Thread-Queue/t/03_peek.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use strict;
use warnings;

use Config;
BEGIN {
use Config;
if (! $Config{'useithreads'}) {
print("1..0 # SKIP Perl not compiled with 'useithreads'\n");
exit(0);
Expand All @@ -11,16 +11,7 @@ BEGIN {

use threads;
use Thread::Queue;

BEGIN { # perl RT 133382
if ($] == 5.008) {
require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
Test::More->import();
} # end BEGIN
plan('tests' => 19);
use Test::More 'tests' => 19;

my $q = Thread::Queue->new(1..10);
ok($q, 'New queue');
Expand Down
11 changes: 1 addition & 10 deletions dist/Thread-Queue/t/05_extract.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ BEGIN {

use threads;
use Thread::Queue;

BEGIN { # perl RT 133382
if ($] == 5.008) {
require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
Test::More->import();
} # end BEGIN
plan('tests' => 20);
use Test::More 'tests' => 20;

my $q = Thread::Queue->new(1..10);
ok($q, 'New queue');
Expand Down
11 changes: 1 addition & 10 deletions dist/Thread-Queue/t/06_insert.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ BEGIN {

use threads;
use Thread::Queue;

BEGIN { # perl RT 133382
if ($] == 5.008) {
require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
Test::More->import();
} # end BEGIN
plan('tests' => 16);
use Test::More 'tests' => 16;

my $q = Thread::Queue->new(1..10);
ok($q, 'New queue');
Expand Down
11 changes: 1 addition & 10 deletions dist/Thread-Queue/t/07_lock.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ BEGIN {
use threads;
use Thread::Queue;
use Thread::Semaphore;

BEGIN { # perl RT 133382
if ($] == 5.008) {
require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
Test::More->import();
} # end BEGIN
plan('tests' => 3);
use Test::More 'tests' => 3;

# The following tests locking a queue

Expand Down
11 changes: 1 addition & 10 deletions dist/Thread-Queue/t/10_timed.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ BEGIN {

use threads;
use Thread::Queue;

BEGIN { # perl RT 133382
if ($] == 5.008) {
require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
} else {
require Test::More;
}
Test::More->import();
} # end BEGIN
plan('tests' => 19);
use Test::More 'tests' => 19;

### ->dequeue_timed(TIMEOUT, COUNT) test ###

Expand Down
4 changes: 1 addition & 3 deletions dist/Thread-Queue/t/11_limit.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ BEGIN {
use threads;
use Thread::Queue;

use Test::More;

plan tests => 13;
use Test::More tests => 13;

my $q = Thread::Queue->new();
my $rpt = Thread::Queue->new();
Expand Down
Loading