1# Before `make install' is performed this script should be runnable with 2# `make test'. After `make install' it should work as `perl Data-AMF-XS.t' 3 4######################### 5 6# change 'tests => 1' to 'tests => last_test_to_print'; 7my @methods; 8 9use ExtUtils::testlib; 10 11use Storable::AMF0; 12use Storable::AMF3; 13use Storable::AMF; 14use Scalar::Util qw(refaddr); 15@methods = grep !m/thaw0_sv/,@Storable::AMF::EXPORT_OK; 16$totals = ( @methods * 3 - 2 * 4 ) + 2 * 2 + 1 -4 ; 17eval "use Test::More tests => $totals"; 18 19for my $module (qw(Storable::AMF Storable::AMF0 Storable::AMF3)){ 20 for (@methods){ 21 next if m/[03]\z/ && $module ne 'Storable::AMF'; 22 ok($module->can($_), "$module can $_"); 23 } 24} 25 26my ($m, $n); 27($m, $n) = qw(Storable::AMF Storable::AMF0); 28 29is(refaddr $m->can($_), refaddr $n->can($_), "identity for $_ in AMF0") for qw(ref_lost_memory ref-clear); 30 31($m, $n) = qw(Storable::AMF3 Storable::AMF0); 32 33is(refaddr $m->can($_), refaddr $n->can($_), "identity for $_ in AMF3") for qw(ref_lost_memory ref-clear); 34eval{ 35 Storable::AMF0::dclone([]); 36 Storable::AMF0::ref_lost_memory([]); 37}; 38ok(!$@); 39 40######################### 41 42# Insert your test code below, the Test::More module is use()ed here so read 43# its man page ( perldoc Test::More ) for help writing this test script. 44 45