As we're not passing over (or copying in) a NUL, don't need that extra
[p5sagit/p5-mst-13.2.git] / ext / threads / t / thread.t
index 23bd1bf..6020807 100644 (file)
@@ -160,22 +160,22 @@ package main;
     ok($th->join());
 }
 {
-    # there is a little chance this test case will falsly fail
-    # since it tests rand       
+    # There is a miniscule chance this test case may falsely fail
+    # since it tests using rand()
     my %rand : shared;
     rand(10);
     threads->create( sub { $rand{int(rand(10000000000))}++ } ) foreach 1..25;
     $_->join foreach threads->list;
-#    use Data::Dumper qw(Dumper);
-#    print Dumper(\%rand);
-    #$val = rand();
-    ok((keys %rand == 25), "Check that rand works after a new thread");
+    ok((keys %rand >= 23), "Check that rand() is randomized in new threads");
 }
 
 # bugid #24165
 
-run_perl(prog =>
-    'use threads; sub a{threads->create(shift)} $t = a sub{}; $t->tid; $t->join; $t->tid');
+run_perl(prog => 'use threads 1.58;' .
+                 'sub a{threads->create(shift)} $t = a sub{};' .
+                 '$t->tid; $t->join; $t->tid',
+         nolib => ($ENV{PERL_CORE}) ? 0 : 1,
+         switches => ($ENV{PERL_CORE}) ? [] : [ '-Mblib' ]);
 is($?, 0, 'coredump in global destruction');
 
 # test CLONE_SKIP() functionality