Acme-Cat-Schroedinger

 view release on metacpan or  search on metacpan

t/basic.t  view on Meta::CPAN


ok (!ref (kitty.''), "Stringification works");

ok (ref ($cat), 'Cat is an object');

my $nvm = $cat.'dog';
ok (!ref ($cat), "stringification modifies the cat") or diag Dumper [$cat];

$cat = kitty;

eval {
	$nvm = $cat->[0];
};
if ($@) {
	fail ($@);
}
else {
	pass('Can call as arrayref');
	ok (!defined $nvm, 'empty arrayref');
}

eval {
	$nvm = ${&kitty};
};
if ($@) {
	fail ($@);
}
else {
	pass('Can call as scalar ref');
}

eval {
	$nvm = &kitty->();
};
if ($@) {
	fail ($@);
}
else {
	pass('Can call as code ref');
	is($nvm->(), 'meow', 'Can meow as code ref');
}


eval {
	$nvm = {%{&kitty}};
};
if ($@) {
	fail ($@);
}
else {
	pass('Can call as hash ref');
	ok (!keys %$nvm ,'empty hashref');
}

sub perverse_kitty {kitty(temperament=>'perverse',@_)}
eval {
	$nvm = perverse_kitty.''
};
if ($@) {
	pass ('A properly perverse cat cannot be concatenated');
}
else {
	fail('A properly perverse cat cannot be concatenated');
	diag Dumper [$nvm];
}
eval {
	$nvm = perverse_kitty->{temperament}
};
if ($@) {
	pass ('A properly perverse cat cannot be dereferenced');
}
else {
	fail('A properly perverse cat cannot be dereferenced');
}


t/manifest.t  view on Meta::CPAN

#!perl -T

use strict;
use warnings;
use Test::More;

unless ( $ENV{RELEASE_TESTING} ) {
    plan( skip_all => "Author tests not required for installation" );
}

eval "use Test::CheckManifest 0.9";
plan skip_all => "Test::CheckManifest 0.9 required" if $@;
ok_manifest();

t/pod-coverage.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;

# Ensure a recent version of Test::Pod::Coverage
my $min_tpc = 1.08;
eval "use Test::Pod::Coverage $min_tpc";
plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
    if $@;

# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
# but older versions don't recognize some common documentation styles
my $min_pc = 0.18;
eval "use Pod::Coverage $min_pc";
plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
    if $@;

all_pod_coverage_ok();

t/pod.t  view on Meta::CPAN

#!perl -T

use strict;
use warnings;
use Test::More;

# Ensure a recent version of Test::Pod
my $min_tp = 1.22;
eval "use Test::Pod $min_tp";
plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;

all_pod_files_ok();



( run in 1.343 second using v1.01-cache-2.11-cpan-5a3173703d6 )