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