Condition Coverage

blib/lib/Twitter/Text.pm
Criterion Covered Total %
condition 55 66 83.3


and 3 conditions

line !l l&&!r l&&r condition
75 1 1 2 $prev and $prev->{'indices'}[1] > $entity->{'indices'}[0]
210 1 105 1707 $text and $options->{'extract_url_without_protocol'} ? $text =~ /\./u : $text =~ /:/u
247 0 14 1 $2 and length $2 >= 40
297 1 0 6 scalar @$extracted == 1 && $extracted->[0] eq substr($hashtag, 1)
302 1 0 1 $username_list =~ /\A($Twitter::Text::Regexp::valid_mention_or_list)\z/u && $2 eq '' && $5 && length $5
313 0 0 31 $url_parts and $url_parts eq $url
316 1 1 29 !$require_protocol || _valid_match($scheme, $Twitter::Text::Regexp::validate_url_scheme) && $scheme =~ /\Ahttps?\Z/iu and _valid_match($path, $Twitter::Text::Regexp::validate_url_path)
2 0 29 !$require_protocol || _valid_match($scheme, $Twitter::Text::Regexp::validate_url_scheme) && $scheme =~ /\Ahttps?\Z/iu and _valid_match($path, $Twitter::Text::Regexp::validate_url_path) and _valid_match($query, $Twitter::Text::Regexp::validate_url_query, 1)
1 1 28 !$require_protocol || _valid_match($scheme, $Twitter::Text::Regexp::validate_url_scheme) && $scheme =~ /\Ahttps?\Z/iu and _valid_match($path, $Twitter::Text::Regexp::validate_url_path) and _valid_match($query, $Twitter::Text::Regexp::validate_url_query, 1) and _valid_match($fragment, $Twitter::Text::Regexp::validate_url_fragment, 1)
327 2 8 74 defined $string && $string =~ /($regex)/u && $1 eq $string
328 49 8 1 defined $string && (!($string =~ /($regex)/u) || $1 ne $string)
337 0 1 3 scalar @$extracted == 1 && $extracted->[0] eq substr($username, 1)
409 3 5759 26811 $range_start <= $chr and $chr <= $range_end
422 5 23790 5190 not $has_invalid_chars and $weighted_count <= $scaled_max_weighted_tweet_length
430 1 20 30 !$has_invalid_chars && $scaled_weighted_length <= $max_weighted_tweet_length

or 2 conditions

line l !l condition
188 4 34 $list_slug || ''
206 1 1812 $options ||= {'extract_url_without_protocol', 1}
343 28 24 $options ||= {}

or 3 conditions

line l !l&&r !l&&!r condition
223 0 15 44 not $options->{'extract_url_without_protocol'} or $before =~ /$Twitter::Text::Regexp::invalid_url_without_protocol_preceding_chars/u
316 5 25 1 !$require_protocol || _valid_match($scheme, $Twitter::Text::Regexp::validate_url_scheme) && $scheme =~ /\Ahttps?\Z/iu
321 18 0 10 $unicode_domains && _valid_match($authorithy, $Twitter::Text::Regexp::validate_url_unicode_authority) || !$unicode_domains && _valid_match($authorithy, $Twitter::Text::Regexp::validate_url_authority)
350 27 24 0 $options->{'config'} || Twitter::Text::Configuration::default_configuration()
459 3 0 28978 not $text or length $text == 0