Acme-PrettyCure
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
This is known to create infinite loops in make.
Please correct this, then run $0 again.
END_DIE
inc/Test/Exception.pm view on Meta::CPAN
#line 1
use strict;
use warnings;
package Test::Exception;
use Test::Builder;
use Sub::Uplevel qw( uplevel );
use base qw( Exporter );
our $VERSION = '0.31';
our @EXPORT = qw(dies_ok lives_ok throws_ok lives_and);
my $Tester = Test::Builder->new;
sub import {
my $self = shift;
if ( @_ ) {
my $package = caller;
$Tester->exported_to( $package );
$Tester->plan( @_ );
};
inc/Test/Exception.pm view on Meta::CPAN
package DB;
if( wantarray ) {
if ( !@_ ) {
return (CORE::caller($height))[0..2];
}
else {
# If we got here, we are within a Test::Exception test, and
# something is producing a stacktrace. In case this is a full
# trace (i.e. confess() ), we have to make sure that the sub
# args are not visible. If we do not do this, and the test in
# question is throws_ok() with a regex, it will end up matching
# against itself in the args to throws_ok().
#
# While it is possible (and maybe wise), to test if we are
# indeed running under throws_ok (by crawling the stack right
# up from here), the old behavior of Test::Exception was to
# simply obliterate @DB::args altogether in _quiet_caller, so
# we are just preserving the behavior to avoid surprises
#
my @frame_info = CORE::caller($height);
@DB::args = ();
return @frame_info;
}
}
inc/Test/Exception.pm view on Meta::CPAN
$exception = "$class ($exception)"
if $class && "$exception" !~ m/^\Q$class/;
chomp $exception;
return "$prefix $exception";
};
#line 206
sub throws_ok (&$;$) {
my ( $coderef, $expecting, $description ) = @_;
unless (defined $expecting) {
require Carp;
Carp::croak( "throws_ok: must pass exception class/object or regex" );
}
$description = _exception_as_string( "threw", $expecting )
unless defined $description;
my $exception = _try_as_caller( $coderef );
my $regex = $Tester->maybe_regex( $expecting );
my $ok = $regex
? ( $exception =~ m/$regex/ )
: eval {
$exception->isa( ref $expecting ? ref $expecting : $expecting )
};
t/10_first.t view on Meta::CPAN
use Acme::PrettyCure;
# skip warnings
binmode(Test::More->builder->$_, ':utf8') for qw/failure_output output todo_output/;
my ($nagi, $hono) = Acme::PrettyCure->members('First');
isa_ok $nagi, 'Acme::PrettyCure::CureBlack';
isa_ok $hono, 'Acme::PrettyCure::CureWhite';
throws_ok { $nagi->transform } qr/ã¡ã/, 'å代ã¯åç¬å¤èº«ä¸å¯è½';
throws_ok { $nagi->transform($nagi) } qr/ã¡ã/, 'ã»ã®ã以å¤ã¨ãå¤èº«ã¯åºæ¥ãªã';
throws_ok { $hono->transform } qr/ãã/, 'å代ã¯åç¬å¤èº«ä¸å¯è½';
throws_ok { $hono->transform($hono) } qr/ãã/, 'ãªãã以å¤ã¨ãå¤èº«ã¯åºæ¥ãªã';
is $nagi->name, 'ç¾å¢¨ãªãã';
is $hono->name, 'éªåã»ã®ã';
$nagi->transform($hono);
is $nagi->name, 'ãã¥ã¢ãã©ãã¯';
is $hono->name, 'ãã¥ã¢ãã¯ã¤ã';
done_testing;
t/10_splasstar.t view on Meta::CPAN
use Acme::PrettyCure;
# skip warnings
binmode(Test::More->builder->$_, ':utf8') for qw/failure_output output todo_output/;
my ($saki, $mai) = Acme::PrettyCure->members('SplashStar');
isa_ok $saki, 'Acme::PrettyCure::CureBloom';
isa_ok $mai, 'Acme::PrettyCure::CureEgret';
throws_ok { $saki->transform } qr/ã©ã/, 'SSãåç¬å¤èº«ä¸å¯è½';
throws_ok { $saki->transform($saki) } qr/ã©ã/, 'è以å¤ã¨ãå¤èº«ã¯åºæ¥ãªã';
throws_ok { $mai->transform } qr/ãã§ã/, 'å代ã¯åç¬å¤èº«ä¸å¯è½';
throws_ok { $mai->transform($mai) } qr/ãã§ã/, 'å²ä»¥å¤ã¨ãå¤èº«ã¯åºæ¥ãªã';
is $saki->name, 'æ¥åå²';
is $mai->name, 'ç¾ç¿è';
$saki->transform($mai);
is $saki->name, 'ãã¥ã¢ãã«ã¼ã ';
is $mai->name, 'ãã¥ã¢ã¤ã¼ã°ã¬ãã';
$saki = $saki->powerup;
( run in 0.261 second using v1.01-cache-2.11-cpan-496ff517765 )