summaryrefslogtreecommitdiff
path: root/t/op/threads.t
diff options
context:
space:
mode:
authorJerry D. Hedden <jdhedden@cpan.org>2007-06-27 10:15:16 -0400
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-06-28 06:17:04 +0000
commit09576c7db8c59458f52d7746e7f4062d64ff34e7 (patch)
tree6ed4f0f8b10aa5c384e8e2ce5e9ff6da566285e8 /t/op/threads.t
parent52cc710768675452226d280165d6b448662d5d4b (diff)
downloadperl-09576c7db8c59458f52d7746e7f4062d64ff34e7.tar.gz
Move tests under 'threads' module
From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510706271115n6c816334nbde6774792743a54@mail.gmail.com> p4raw-id: //depot/perl@31488
Diffstat (limited to 't/op/threads.t')
-rw-r--r--t/op/threads.t38
1 files changed, 11 insertions, 27 deletions
diff --git a/t/op/threads.t b/t/op/threads.t
index bd4009ce5a..e52a115004 100644
--- a/t/op/threads.t
+++ b/t/op/threads.t
@@ -1,25 +1,26 @@
-#!./perl
+#!perl
+
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
$| = 1;
-}
-use strict;
-use Config;
-
-BEGIN {
- if (!$Config{useithreads}) {
- print "1..0 # Skip: no ithreads\n";
- exit 0;
+ require Config;
+ if (!$Config::Config{useithreads}) {
+ print "1..0 # Skip: no ithreads\n";
+ exit 0;
}
if ($ENV{PERL_CORE_MINITEST}) {
print "1..0 # Skip: no dynamic loading on miniperl, no threads\n";
exit 0;
}
- plan(11);
+
+ plan(9);
}
+
+use strict;
+use warnings;
use threads;
# test that we don't get:
@@ -114,28 +115,11 @@ use threads;
print do 'op/threads_create.pl' || die $@;
EOI
-# Attempt to free unreferenced scalar...
-fresh_perl_is(<<'EOI', 'ok', { }, 'thread sub via scalar');
- use threads;
- my $test = sub {};
- threads->create($test)->join();
- print 'ok';
-EOI
-
-# Attempt to free unreferenced scalar...
-fresh_perl_is(<<'EOI', 'ok', { }, 'thread sub via $_[0]');
- use threads;
- sub thr { threads->new($_[0]); }
- thr(sub { })->join;
- print 'ok';
-EOI
TODO: {
no strict 'vars'; # Accessing $TODO from test.pl
local $TODO = 'refcount issues with threads';
-
-
# Scalars leaked: 1
foreach my $BLOCK (qw(CHECK INIT)) {
fresh_perl_is(<<EOI, 'ok', { }, "threads in $BLOCK block");