Scalar-List-Utils

 view release on metacpan or  search on metacpan

t/prototype.t  view on Meta::CPAN

is( prototype('f'), '$', 'prototype');
is( CORE::prototype('f'), '$', 'prototype from CORE');
is( $r,   \&f, 'return value');

set_prototype(undef, \&f);
is( prototype('f'), undef, 'remove prototype');

set_prototype('', \&f);
is( prototype('f'), '', 'empty prototype');

sub g (@) { }
is( prototype('g'), '@', '@ prototype');

set_prototype(undef, \&g);
is( prototype('g'), undef, 'remove prototype');

sub stub;
is( prototype('stub'), undef, 'non existing sub');

set_prototype('$$$', \&stub);
is( prototype('stub'), '$$$', 'change non existing sub');

t/scalarutil-proto.t  view on Meta::CPAN

my $r = set_prototype(\&f,'$');
is( prototype('f'), '$', 'set prototype');
is( $r, \&f, 'return value');

set_prototype(\&f,undef);
is( prototype('f'), undef, 'remove prototype');

set_prototype(\&f,'');
is( prototype('f'), '', 'empty prototype');

sub g (@) { }
is( prototype('g'), '@', '@ prototype');

set_prototype(\&g,undef);
is( prototype('g'), undef, 'remove prototype');

sub stub;
is( prototype('stub'), undef, 'non existing sub');

set_prototype(\&stub,'$$$');
is( prototype('stub'), '$$$', 'change non existing sub');



( run in 2.971 seconds using v1.01-cache-2.11-cpan-4ab04211f4c )