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
77 1 1 2 $prev and $prev->{'indices'}[1] > $entity->{'indices'}[0]
212 1 105 1707 $text and $options->{'extract_url_without_protocol'} ? $text =~ /\./ : $text =~ /:/
251 0 14 1 $2 and length $2 >= 40
301 1 0 6 scalar @$extracted == 1 && $extracted->[0] eq substr($hashtag, 1)
306 1 0 1 $username_list =~ /\A($Twitter::Text::Regexp::valid_mention_or_list)\z/ && $2 eq '' && $5 && length $5
317 0 0 31 $url_parts and $url_parts eq $url
320 1 1 29 !$require_protocol || _valid_match($scheme, $Twitter::Text::Regexp::validate_url_scheme) && $scheme =~ /\Ahttps?\Z/i 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/i 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/i 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)
331 2 8 74 defined $string && $string =~ /($regex)/ && $1 eq $string
332 49 8 1 defined $string && (!($string =~ /($regex)/) || $1 ne $string)
341 0 1 3 scalar @$extracted == 1 && $extracted->[0] eq substr($username, 1)
414 3 5759 26811 $range_start <= $chr and $chr <= $range_end
427 5 23790 5190 not $has_invalid_chars and $weighted_count <= $scaled_max_weighted_tweet_length
435 1 20 30 !$has_invalid_chars && $scaled_weighted_length <= $max_weighted_tweet_length

or 2 conditions

line l !l condition
190 4 34 $list_slug || ''
208 1 1812 $options ||= {'extract_url_without_protocol', 1}
348 28 24 $options ||= {}

or 3 conditions

line l !l&&r !l&&!r condition
225 0 15 44 not $options->{'extract_url_without_protocol'} or $before =~ /$Twitter::Text::Regexp::invalid_url_without_protocol_preceding_chars/
320 5 25 1 !$require_protocol || _valid_match($scheme, $Twitter::Text::Regexp::validate_url_scheme) && $scheme =~ /\Ahttps?\Z/i
325 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)
355 27 24 0 $options->{'config'} || Twitter::Text::Configuration::default_configuration()
465 3 0 28978 not $text or length $text == 0