AnyEvent-RipeRedis
view release on metacpan or search on metacpan
t/04-commands.t view on Meta::CPAN
);
is( $t_reply, 'ÐнаÑение', 'read UTF-8 string; GET' );
return;
}
sub t_get_non_existent {
my $redis = shift;
my $t_reply = 'not_undef';
my $t_err;
ev_loop(
sub {
my $cv = shift;
$redis->get( 'non_existent',
sub {
$t_reply = shift;
$t_err = shift;
t/04-commands.t view on Meta::CPAN
);
is_deeply( $t_reply, [], 'read empty list; LRANGE' );
return;
}
sub t_mbulk_reply_undef {
my $redis = shift;
my $t_reply = 'not_undef';
my $t_err;
ev_loop(
sub {
my $cv = shift;
$redis->brpop( 'non_existent', '1',
sub {
$t_reply = shift;
$t_err = shift;
t/10-exceptions.t view on Meta::CPAN
use strict;
use warnings;
use Test::More tests => 20;
use Test::Fatal;
use AnyEvent::RipeRedis;
t_conn_timeout();
t_read_timeout();
t_reconnect_interval();
t_not_allowed_after_multi();
t_on_message();
sub t_conn_timeout {
like(
exception {
my $redis = AnyEvent::RipeRedis->new(
connection_timeout => 'invalid',
);
},
t/10-exceptions.t view on Meta::CPAN
exception {
$redis->reconnect_interval(-5);
},
qr/"reconnect_interval" must be a positive number/,
q{invalid "reconnect_interval" (negative number; accessor)},
);
return;
}
sub t_not_allowed_after_multi {
my $redis = AnyEvent::RipeRedis->new(
on_error => sub {
# do not print error
}
);
$redis->multi;
like(
exception {
( run in 0.550 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )