6 if (! $Config{'useithreads'}) {
7 print("1..0 # SKIP Perl not compiled with 'useithreads'\n");
15 BEGIN { # perl RT 133382
17 require 't/test.pl'; # Test::More work-alike for Perl 5.8.0
25 my $q = Thread::Queue->new(1..10);
28 $q->enqueue([ qw/foo bar/ ]);
32 is($q->peek(3), 4, 'Peek at queue');
33 is($q->peek(-3), 9, 'Negative peek');
35 my $nada = $q->peek(20);
36 ok(! defined($nada), 'Big peek');
37 $nada = $q->peek(-20);
38 ok(! defined($nada), 'Big negative peek');
40 my $ary = $q->peek(-1);
41 is_deeply($ary, [ qw/foo bar/ ], 'Peek array');
43 is($q->pending(), 11, 'Queue count in thread');
48 threads->create('q_check')->join();