3 # Test to see if is_deeply() plays well with threads.
6 if( $ENV{PERL_CORE} ) {
8 @INC = ('../lib', 'lib');
11 unshift @INC, 't/lib';
19 unless ( $] >= 5.008001 && $Config{'useithreads'} &&
20 eval { require threads; 'threads'->import; 1; })
22 print "1..0 # Skip: no working threads\n";
26 unless ( $ENV{AUTHOR_TESTING} ) {
27 print "1..0 # Skip: many perls have broken threads. Enable with AUTHOR_TESTING.\n";
35 plan tests => $Num_Threads * 100 + 6;
40 my @list = ( 'x', 'yy', 'zzz', 'a', 'bb', 'ccc', 'aaaaa', 'z',
41 'hello', 's', 'thisisalongname', '1', '2', '3',
42 'abc', 'xyz', '1234567890', 'm', 'n', 'p' );
44 print "# kid $kid before is_deeply\n";
47 is_deeply(\@list, \@list2);
49 print "# kid $kid exit\n";
54 for my $i (1..$Num_Threads) {
55 my $t = threads->new(\&do_one_thread, $i);
56 print "# parent $$: continue\n";
60 print "# parent $$: waiting for join\n";
62 cmp_ok( $rc, '==', 42, "threads exit status is $rc" );