/usr/share/doc/perl-Test-Simple/t/Legacy
#!/usr/bin/perl -w # Test to see if is_deeply() plays well with threads. BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @INC = ('../lib', 'lib'); } else { unshift @INC, 't/lib'; } } use strict; use Test2::Util qw/CAN_THREAD/; BEGIN { unless(CAN_THREAD) { require Test::More; Test::More->import(skip_all => "threads are not supported"); } } use threads; BEGIN { unless ( $ENV{AUTHOR_TESTING} ) { print "1..0 # Skip many perls have broken threads. Enable with AUTHOR_TESTING.\n"; exit 0; } } use Test::More; my $Num_Threads = 5; plan tests => $Num_Threads * 100 + 6; sub do_one_thread { my $kid = shift; my @list = ( 'x', 'yy', 'zzz', 'a', 'bb', 'ccc', 'aaaaa', 'z', 'hello', 's', 'thisisalongname', '1', '2', '3', 'abc', 'xyz', '1234567890', 'm', 'n', 'p' ); my @list2 = @list; print "# kid $kid before is_deeply\n"; for my $j (1..100) { is_deeply(\@list, \@list2); } print "# kid $kid exit\n"; return 42; } my @kids = (); for my $i (1..$Num_Threads) { my $t = threads->new(\&do_one_thread, $i); print "# parent $$: continue\n"; push(@kids, $t); } for my $t (@kids) { print "# parent $$: waiting for join\n"; my $rc = $t->join(); cmp_ok( $rc, '==', 42, "threads exit status is $rc" ); } pass("End of test");
.
Edit
..
Edit
00test_harness_check.t
Edit
01-basic.t
Edit
478-cmp_ok_hash.t
Edit
BEGIN_require_ok.t
Edit
BEGIN_use_ok.t
Edit
Bugs
Edit
Builder
Edit
More.t
Edit
Regression
Edit
Simple
Edit
Test2
Edit
Tester
Edit
auto.t
Edit
bad_plan.t
Edit
bail_out.t
Edit
buffer.t
Edit
c_flag.t
Edit
capture.t
Edit
check_tests.t
Edit
circular_data.t
Edit
cmp_ok.t
Edit
depth.t
Edit
diag.t
Edit
died.t
Edit
dont_overwrite_die_handler.t
Edit
eq_set.t
Edit
exit.t
Edit
explain.t
Edit
explain_err_vars.t
Edit
extra.t
Edit
extra_one.t
Edit
fail-like.t
Edit
fail-more.t
Edit
fail.t
Edit
fail_one.t
Edit
filehandles.t
Edit
fork.t
Edit
harness_active.t
Edit
import.t
Edit
is_deeply_dne_bug.t
Edit
is_deeply_fail.t
Edit
is_deeply_with_threads.t
Edit
missing.t
Edit
new_ok.t
Edit
no_log_results.t
Edit
no_plan.t
Edit
no_tests.t
Edit
note.t
Edit
overload.t
Edit
overload_threads.t
Edit
plan.t
Edit
plan_bad.t
Edit
plan_is_noplan.t
Edit
plan_no_plan.t
Edit
plan_shouldnt_import.t
Edit
plan_skip_all.t
Edit
require_ok.t
Edit
run_test.t
Edit
simple.t
Edit
skip.t
Edit
skipall.t
Edit
strays.t
Edit
subtest
Edit
tbm_doesnt_set_exported_to.t
Edit
thread_taint.t
Edit
threads.t
Edit
todo.t
Edit
undef.t
Edit
use_ok.t
Edit
useing.t
Edit
utf8.t
Edit
versions.t
Edit