Branch Coverage

blib/lib/Twitter/Text.pm
Criterion Covered Total %
branch 91 94 96.8


line true false branch
77 2 2 unless ($prev and $prev->{'indices'}[1] > $entity->{'indices'}[0])
93 1 10 unless $text =~ /\$/
118 1 84 unless $text =~ /[#\x{ff03}]/
120 83 1 unless exists $options->{'check_url_overlap'}
130 149 2 unless ($after =~ /$Twitter::Text::Regexp::end_hashtag_match/)
138 83 1 if ($options->{'check_url_overlap'})
141 1 82 if (@$urls)
161 1 31 unless $text
166 1 31 if length $mention_or_list->{'list_slug'}
179 1 36 unless $text =~ /[\@\x{ff20}]/
186 4 38 defined $list_slug ? :
189 38 4 unless ($after =~ /$Twitter::Text::Regexp::end_mention_match/)
212 1811 1 $options->{'extract_url_without_protocol'} ? :
106 1707 unless $text and $options->{'extract_url_without_protocol'} ? $text =~ /\./ : $text =~ /:/
224 59 1706 if (not $protocol) { }
225 15 44 if not $options->{'extract_url_without_protocol'} or $before =~ /$Twitter::Text::Regexp::invalid_url_without_protocol_preceding_chars/
230 2 53 unless _is_valid_domain(length $url, $ascii_domain, $protocol)
239 2 42 unless $last_url
242 15 27 if ($path)
250 15 1691 if ($url =~ /($Twitter::Text::Regexp::valid_tco_url)/)
251 1 14 if $2 and length $2 >= 40
256 10 1695 unless _is_valid_domain(length $url, $domain, $protocol)
271 0 1760 unless $domain
276 12 1748 if ($@)
280 168 1580 if $updated_domain_length > $original_domain_length
281 53 1695 unless $protocol
298 1 7 unless length $hashtag
311 2 31 exists $opts{'unicode_domains'} ? :
312 6 27 exists $opts{'require_protocol'} ? :
314 2 31 unless $url
317 0 31 unless $url_parts and $url_parts eq $url
320 1 28 unless !$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 84 58 unless $optional
338 1 4 unless $username
352 1 51 unless length $normalized_text > 0
362 24 27 $config->{'emojiParsingEnabled'} ? :
375 37 26212 if ($url_entity->{'indices'}[0] == $offset)
381 31 6 if ($weighted_count <= $scaled_max_weighted_tweet_length)
390 318 22649 if ($emoji_entity->{'indices'}[0] == $offset)
396 298 20 if ($weighted_count <= $scaled_max_weighted_tweet_length)
404 355 28985 if $entity_length > 0
406 28985 0 if ($offset < length $normalized_text)
413 26811 5762 if ($range_start <= $chr and $chr <= $range_end)
421 28981 4 unless $has_invalid_chars
426 5190 23795 if (not $has_invalid_chars and $weighted_count <= $scaled_max_weighted_tweet_length)
438 30 21 $is_valid ? :
463 3 28978 if not $text or length $text == 0