Lines Matching refs:test
22 printf("# Failed test at line %d\n", (caller)[2]);
33 my $test = 1;
37 ok($test++, 1, 'Loaded');
43 ok($test++, $x == 14, 'number');
45 $x = shared_clone('test');
46 ok($test++, $x eq 'test', 'string');
54 ok($test++, $@ =~ /Usage:/, '1 arg');
60 my $x = 'test';
62 ok($test++, $foo eq 'test', 'cloned string');
65 ok($test++, $$foo eq 'test', 'cloned scalar ref');
68 ok($test++, $$foo eq 'test', 'cloned scalar ref in thread');
71 $test++;
77 ok($test++, ref($foo) eq 'REF', 'Circular ref typ');
78 ok($test++, threads::shared::_id($foo) == threads::shared::_id($$foo), 'Circular ref');
81 … ok($test++, threads::shared::_id($foo) == threads::shared::_id($$foo), 'Circular ref in thread');
88 $test++;
90 ok($test++, threads::shared::_id($$foo) == threads::shared::_id($$$$$foo),
98 ok($test++, $ary->[1] eq 'bar', 'Cloned array');
100 ok($test++, $ary->[1] == 99, 'Clone mod');
101 ok($test++, $ary[1] eq 'bar', 'Original array');
104 ok($test++, $ary->[1] == 99, 'Clone mod in thread');
110 $test++;
112 ok($test++, $ary->[1] eq 'thread', 'Clone mod from thread');
113 ok($test++, $ary[1] eq 'bar', 'Original array');
118 ok($test++, is_shared($hsh), 'Shared hash ref');
119 ok($test++, is_shared($hsh->{'foo'}), 'Shared hash ref elem');
120 ok($test++, $$hsh{'foo'}[1] eq 'bar', 'Cloned structure');
129 ok($test++, $$bork == 99, 'cloned scalar ref object');
130 ok($test++, ($] < 5.008003) || Internals::SvREADONLY($$bork), 'read-only');
131 ok($test++, ref($bork) eq 'Bork', 'Object class');
134 ok($test++, $$bork == 99, 'cloned scalar ref object in thread');
135 ok($test++, ($] < 5.008003) || Internals::SvREADONLY($$bork), 'read-only');
136 ok($test++, ref($bork) eq 'Bork', 'Object class');
139 $test += 3;
159 ok($test++, ${$copy->{'ref'}} eq 'zip', 'Obj ref in thread');
160 …ok($test++, threads::shared::_id($copy) == threads::shared::_id($copy->{'self'}), 'Circular ref in…
161 ok($test++, is_shared($copy->{'ary'}->[2]), 'Shared element in cloned obj');
164 $test += 3;
166 ok($test++, ref($copy) eq 'Foo', 'Obj cloned by thread');
167 ok($test++, ${$copy->{'ref'}} eq 'zip', 'Obj ref in thread');
168 …ok($test++, threads::shared::_id($copy) == threads::shared::_id($copy->{'self'}), 'Circular ref in…
169 ok($test++, $copy->{'ary'}->[3]->{'bar'}->[0] eq 'baz', 'Deeply cloned');
170 ok($test++, ref($copy) eq 'Foo', 'Cloned object class');
179 ok($test++, $@ =~ /Unsupported/, 'Cannot clone GLOB - fatal');
180 ok($test++, ! defined($copy), 'Nothing cloned');
186 ok($test++, $warn =~ /Unsupported/, 'Cannot clone GLOB - warning');
187 ok($test++, ! defined($copy), 'Nothing cloned');
192 ok($test++, ! defined($warn), 'Cannot clone GLOB - silent');
193 ok($test++, ! defined($copy), 'Nothing cloned');