3 # This is a home for regular expression tests that don't fit into
4 # the format supported by re/regexp.t. If you want to add a test
5 # that does fit that format, add it to re/re_tests, not here.
17 set_up_inc('../lib', '.', '../ext/re');
18 require Config; Config->import;
21 skip_all_without_config('useithreads');
22 skip_all_if_miniperl("no dynamic loading on miniperl, no threads");
24 plan tests => 6; # Update this when adding/deleting tests.
26 run_tests() unless caller;
33 for my $len (10,100,1000) {
34 my $result1= fresh_perl(sprintf(<<'EOF_CODE', $len),
40 split /[.;]+[\'\"]+/, $_[0];
44 my $buffer = '.' x %d;
49 my $result2= fresh_perl(sprintf(<<'EOF_CODE', $len),
55 split /[.;]+[\'\"]+/, $_[0];
59 my $buffer = '.' x %d;
60 my $thr = threads->create('start_thread', $buffer);
64 for ($result1, $result2) {
65 (undef,$_,undef)= split /\n===\n/, $_;
67 my @l1= split /\n/, $result1;
68 my @l2= split /\n/, $result2;
70 is(0+@l2,0+@l1, sprintf
71 "Threaded and unthreaded stclass behavior matches (n=%d)",
75 my $n100= $res[1]/100;
76 my $n1000= $res[2]/1000;
77 ok(abs($n10-$n100)<1,"Behavior appears to be sub quadratic ($n10, $n100)");
78 ok(abs($n100-$n1000)<0.1,"Behavior is linear and not quadratic ($n100, $n1000)");
79 ok(abs(3-$n1000)<0.1,"Behavior is linear as expected");