2 # $Id: /mirror/googlecode/test-more-trunk/t/is_deeply_with_threads.t 60989 2008-09-10T03:05:54.548376Z schwern $
4 # Test to see if is_deeply() plays well with threads.
7 if( $ENV{PERL_CORE} ) {
9 @INC = ('../lib', 'lib');
12 unshift @INC, 't/lib';
20 unless ( $] >= 5.008001 && $Config{'useithreads'} &&
21 eval { require threads; 'threads'->import; 1; })
23 print "1..0 # Skip no working threads\n";
27 unless ( $ENV{AUTHOR_TESTING} ) {
28 print "1..0 # Skip many perls have broken threads. Enable with AUTHOR_TESTING.\n";
36 plan tests => $Num_Threads * 100 + 6;
41 my @list = ( 'x', 'yy', 'zzz', 'a', 'bb', 'ccc', 'aaaaa', 'z',
42 'hello', 's', 'thisisalongname', '1', '2', '3',
43 'abc', 'xyz', '1234567890', 'm', 'n', 'p' );
45 print "# kid $kid before is_deeply\n";
48 is_deeply(\@list, \@list2);
50 print "# kid $kid exit\n";
55 for my $i (1..$Num_Threads) {
56 my $t = threads->new(\&do_one_thread, $i);
57 print "# parent $$: continue\n";
61 print "# parent $$: waiting for join\n";
63 cmp_ok( $rc, '==', 42, "threads exit status is $rc" );