6 if ($Config{'useithreads'}) {
7 Test::More->import( tests => 53 );
10 Test::More->import(skip_all => "no useithreads");
21 is(keys %hash, 0, "hash empty");
23 is(keys %hash,1, "Assign grows hash");
24 is($hash{0},$val[0],"Value correct");
26 is(keys %hash,2, "Assign grows hash");
27 is($hash{0},$val[0],"Value correct");
28 is($hash{2},$val[2],"Value correct");
30 is(keys %hash,3,"Size correct");
31 my @keys = keys %hash;
32 is(join(',',sort @keys),'0,1,2',"Keys correct");
33 my @hval = @hash{0,1,2};
34 is(join(',',@hval),join(',',@val),"Values correct");
35 my $val = delete $hash{1};
36 is($val,$val[1],"Delete value correct");
37 is(keys %hash,2,"Size correct");
38 while (my ($k,$v) = each %hash)
40 is($v,$val[$k],"each works");
43 is(keys %hash,0,"Clear hash");
49 is(@array, 0, "array empty");
51 is(@array,1, "Assign grows array");
52 is($array[0],$val[0],"Value correct");
53 unshift(@array,$val[2]);
54 is($array[0],$val[2],"Unshift worked");
55 is($array[-1],$val[0],"-ve index");
57 is($array[-1],$val[1],"Push worked");
58 is(@array,3,"Size correct");
59 is(shift(@array),$val[2],"Shift worked");
60 is(@array,2,"Size correct");
61 is(pop(@array),$val[1],"Pop worked");
62 is(@array,1,"Size correct");
64 is(@array,0,"Clear array");
67 ok((require threads::shared),"Require module");
73 import threads::shared;
79 # ok(0,"No it isn't");