YahooMessenger/SendMessage.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 32 CC 3 SCAR 13.9
CC
3
Cov
0%
body
6.0
to
6.0
code
2.0
CRAP 4.0
1 package Net::YahooMessenger::SendMessage;
2 use base 'Net::YahooMessenger::Event';
3  
4 use constant YMSG_SEPARATOR => "\xC0\x80";
5  
6 sub code {
7 return 6;
8 }
9  
10 sub body {
11 my ( $self, $message ) = @_;
12 if ( defined $message ) {
13 $message .=
14 YMSG_SEPARATOR . '63'
15 . YMSG_SEPARATOR . ';0'
16 . YMSG_SEPARATOR . '64'
17 . YMSG_SEPARATOR . '0'
18 . YMSG_SEPARATOR . '1002'
19 . YMSG_SEPARATOR . '1'
20 . YMSG_SEPARATOR . '206'
21 . YMSG_SEPARATOR . '0';
22 }
23 return $self->SUPER::body($message);
24 }
25  
26 sub to {
27 my ( $self, $to ) = @_;
28  
29 if ( defined $to ) {
30 $to .= YMSG_SEPARATOR . '97' . YMSG_SEPARATOR . '1';
31 }
32  
33 return $self->SUPER::to($to);
34  
35 }
36  
37 sub to_string {
38 my $self = shift;
39 sprintf "%s: %s", $self->{sender}, $self->{body};
40  
41 }
42 1;
43 __END__