blib/lib/WWW/Telegram/BotAPI.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
condition | 13 | 56 | 23.2 |
line | !l | l&&!r | l&&r | condition |
---|---|---|---|---|
75 | 4 | 0 | 1 | $settings{'async'} ||= 0 and $settings{'_agent'}->isa('LWP::UserAgent') |
111 | 2 | 0 | 0 | $_ eq 'CODE' and $self->{'async'} |
114 | 2 | 0 | 0 | defined $async_cb and defined $postdata |
141 | 0 | 0 | 0 | $ref eq 'HASH' and exists $postdata->{$k}{'file'} || exists $postdata->{$k}{'content'} |
181 | 0 | 0 | 0 | $is_lwp and push @request, 'Content', $postdata, 'Content_Type', 'form-data' |
188 | 0 | 0 | 2 | $is_lwp and push @request, (), 'Content', &JSON::MaybeXS::encode_json($postdata), 'Content_Type', 'application/json' |
216 | 0 | 0 | 0 | $is_lwp ? $tx->is_success : !$tx->error and $response |
0 | 0 | 0 | $is_lwp ? $tx->is_success : !$tx->error and $response and $response->{'ok'} | |
262 | 0 | 0 | 0 | @$args > 1 and $args->[1] eq 'DBG' |
line | l | !l | condition |
---|---|---|---|
8 | 0 | 3 | $ENV{'TELEGRAM_BOTAPI_DEBUG'} || 0 |
75 | 1 | 4 | $settings{'async'} ||= 0 |
77 | 0 | 4 | $settings{'api_url'} ||= 'https://api.telegram.org/bot%s/%s' |
211 | 0 | 0 | eval { do { &JSON::MaybeXS::decode_json(scalar $tx->decoded_content) } } || undef |
218 | 0 | 0 | $response ||= {} |
224 | 0 | 0 | $error || 'something went wrong!' |
287 | 0 | 0 | (ref($tx->error || {}) ? $tx->error : {'message', $tx->error}) || {} |
line | l | !l&&r | !l&&!r | condition |
---|---|---|---|---|
14 | 0 | 3 | 0 | eval 'require Mojo::UserAgent; 1' or eval 'require LWP::UserAgent; 1' |
57 | 3 | 2 | 0 | $settings{'force_lwp'} or not 'Mojo::UserAgent'->can('new') |
141 | 0 | 0 | 0 | exists $postdata->{$k}{'file'} || exists $postdata->{$k}{'content'} |
220 | 0 | 0 | 0 | $response->{'description'} || ($is_lwp ? $tx->status_line : _mojo_error_to_string($tx)) |
233 | 4 | 0 | 0 | $_[1] || $@ |