Mail-Pyzor
view release on metacpan or search on metacpan
lib/Mail/Pyzor/Digest/Pieces.pm view on Meta::CPAN
=head2 @lines = splitlines( $TEXT )
Imitates C<str.splitlines()>. (cf. C<pydoc str>)
Returns a plain list in list context. Returns the number of
items to be returned in scalar context.
=cut
sub splitlines {
return split m<\r\n?|\n>, $_[0];
}
1;
t/Mail-Pyzor-Client.t view on Meta::CPAN
is_deeply(
$ret,
{
'key2' => 'value2',
'key' => 'value',
},
"$method_name(): The response is read from the handle"
);
my @packet_lines = split m<\n>, $send_packet, -1;
cmp_deeply(
\@packet_lines,
[
"Op: $method_name",
'Op-Digest: fakesha',
( $method_name eq 'report' ? "Op-Spec: $Mail::Pyzor::Client::DEFAULT_OP_SPEC" : () ),
"Thread: $thread_id",
"PV: $Mail::Pyzor::Client::PYZOR_PROTOCOL_VERSION",
"User: $Mail::Pyzor::Client::DEFAULT_USERNAME",
t/Mail-Pyzor-Digest-Pieces.t view on Meta::CPAN
sub _pyzor_normalize {
return _run_pyzor( 'normalize', @_ );
}
sub _pyzor_digest_payloads {
my $out = _run_pyzor( 'digest_payloads', @_ );
my $json = JSON->new()->allow_nonref();
return [ map { $json->decode($_) } split m<\n+>, $out ];
}
sub test_digest_payloads : Tests() {
my ($self) = @_;
SKIP: {
$self->_skip_if_no_python_pyzor( $self->num_tests() );
my %name_message = %{ $self->{'_message_hr'} };
( run in 1.979 second using v1.01-cache-2.11-cpan-71847e10f99 )