Condition Coverage

blib/lib/WWW/Telegram/BotAPI.pm
Criterion Covered Total %
condition 13 54 24.0


and 3 conditions

line !l l&&!r l&&r condition
59 4 0 1 $settings{'async'} ||= 0 and $settings{'_agent'}->isa('LWP::UserAgent')
95 2 0 0 $_ eq 'CODE' and $self->{'async'}
98 2 0 0 defined $async_cb and defined $postdata
125 0 0 0 $ref eq 'HASH' and exists $postdata->{$k}{'file'} || exists $postdata->{$k}{'content'}
165 0 0 0 $is_lwp and push @request, 'Content', $postdata, 'Content_Type', 'form-data'
172 0 0 2 $is_lwp and push @request, (), 'Content', &JSON::MaybeXS::encode_json($postdata), 'Content_Type', 'application/json'
200 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'}
247 0 0 0 @$args > 1 and $args->[1] eq 'DBG'

or 2 conditions

line l !l condition
8 0 3 $ENV{'TELEGRAM_BOTAPI_DEBUG'} || 0
59 1 4 $settings{'async'} ||= 0
61 0 4 $settings{'api_url'} ||= 'https://api.telegram.org/bot%s/%s'
195 0 0 eval { do { &JSON::MaybeXS::decode_json(scalar $tx->decoded_content) } } || undef
202 0 0 $response ||= {}
209 0 0 $error || 'something went wrong!'

or 3 conditions

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'} || !'Mojo::UserAgent'->can('new')
125 0 0 0 exists $postdata->{$k}{'file'} || exists $postdata->{$k}{'content'}
206 0 0 0 $response->{'description'} || ($is_lwp ? $tx->status_line : +((ref($tx->error || {}) ? $tx->error : {'message', $tx->error}) || {})->{'message'})
218 4 0 0 $_[1] || $@