fix occasional op/time.t failure
[p5sagit/p5-mst-13.2.git] / t / op / threads.t
index 99e2e5d..165c542 100644 (file)
@@ -3,6 +3,7 @@ BEGIN {
      chdir 't' if -d 't';
      @INC = '../lib';
      require './test.pl';      # for which_perl() etc
+     $| = 1;
 }
 
 use strict;
@@ -17,7 +18,7 @@ BEGIN {
        print "1..0 # Skip: no dynamic loading on miniperl, no threads\n";
        exit 0;
      }
-     plan(4);
+     plan(6);
 }
 use threads;
 
@@ -95,3 +96,20 @@ sub do_sort_threads {
 
 do_sort_threads(2);        # crashes
 ok(1);
+
+# Change 24643 made the mistake of assuming that CvCONST can only be true on
+# XSUBs. Somehow it can also end up on perl subs.
+fresh_perl_is(<<'EOI', 'ok', { }, 'cloning constant subs');
+use constant x=>1;
+use threads;
+$SIG{__WARN__} = sub{};
+async sub {};
+print "ok";
+EOI
+
+# From a test case by Tim Bunce in
+# http://www.nntp.perl.org/group/perl.perl5.porters/63123
+fresh_perl_is(<<'EOI', 'ok', { }, 'Ensure PL_linestr can be cloned');
+use threads;
+print do 'op/threads_create.pl';
+EOI