Branch Coverage

blib/lib/Decaptcha/TextCaptcha.pm
Criterion Covered Total %
branch 74 76 97.3


line true false branch
42 2 118 unless my $q = shift()
46 2 116 if ($lq eq 'which word in this sentence is all in capitals?')
48 1 1 $word ? :
50 2 114 if ($lq =~ /^(?:the word )?"(.*?)" has how many letters\?$/ or $lq =~ /^how many letters in (?:the word )?"(.*?)"\?$/)
55 2 110 if ($q =~ /^The word in capitals from (.*?) is\?$/ or $q =~ /^Which word is all in capitals: (.*?)\?$/ or $q =~ /^Which of (.*?) is in capitals\?$/)
60 3 1 $word ? :
62 3 104 if ($lq =~ /^which word starts with "(?.)" from the list: (?.*?)\?$/ or $lq =~ /which word from list "(?.*?)" has "(?.)" as a first letter\?$/ or $lq =~ /^what word from "(?.*?)" begins with "(?.)"\?$/ or $lq =~ /^(?.*?): the word starting with "(?.)" is\?$/)
69 2 99 if ($lq =~ /^which word contains "(?[a-z])" from the list: (?.*?)\?$/ or $lq =~ /^(?.*?): the word containing the letter "(?[a-z])" is\?$/ or $lq =~ /^what word from "(?.*?)" contains the letter "(?[a-z])"\?$/ or $lq =~ /^which word from list "(?.*?)" contains the letter "(?[a-z])"\?$/)
76 3 93 if $lq =~ /^the word "(.).*?" starts with which letter\?$/ or $lq =~ /^the letter at the beginning of the word "(.).*?" is\?$/ or $lq =~ /^the word "(.).*?" has which letter at the start\?$/ or $lq =~ /^the (?:last|final) letter of word ".*?(.)" is\?$/ or $lq =~ /^the word ".*?(.)" has which letter at the end\?$/
81 3 90 if ($lq =~ /^the (?

\d+)\S+ letter in (?:the word )?"(?.*?)" is\?$/ or $lq =~ /^the word "(?.*?)" has which letter in (?

\d+)\S+ position\?$/)

85 1 2 $+{'p'} > length $+{'w'} ? :
89 3 86 if ($lq =~ /^tomorrow is (\w+)\. if this is true, what day is today\?$/ or $lq =~ /^if tomorrow is (\w+), what day is today\?$/ or $lq =~ /^what day is today, if tomorrow is (\w+)\?$/)
93 3 1 exists $days{$1} ? :
95 3 82 if ($lq =~ /^yesterday was (\w+)\. if this is true, what day is today\?$/ or $lq =~ /^if yesterday was (\w+), what day is today\?$/ or $lq =~ /^what day is today, if yesterday was (\w+)\?$/)
99 3 1 exists $days{$1} ? :
101 2 76 if ($lq =~ /^which of these is a day of the week: (.*?)\?$/ or $lq =~ /^which of (.*?) is a day of the week\?$/ or $lq =~ /^which of (.*?) is the name of a day\?$/ or $lq =~ /^the day of the week in (.*?) is\?$/ or $lq =~ /^(.*?): the day of the week is\?$/)
109 4 72 if ($lq =~ /^(.*?) is part of the weekend\?$/)
114 2 68 if $lq =~ /^(\w+)'s? name is\?$/ or $lq =~ /^what is (\w+)'s? name\?$/ or $lq =~ /^the name of (\w+) is\?$/ or $lq =~ /^if a person is called (\w+), what is their name\?$/
118 1 62 if ($q =~ /^The person's firstname in (.*?) is\?$/ or $q =~ /^Which in this list is the name of a person: (.*?)\?$/ or $q =~ /^(.*?): the person's name is\?$/ or $q =~ /^Which of (.*?) is the name of a person\?$/ or $q =~ /^Which of (.*?) is a person's name\?$/)
125 5 1 $name ? :
129 2 59 if $lq =~ /^the colour of a (\w+) \S+ is\?$/ or $lq =~ /^the (\w+) \S+ is what colour\?$/ or $lq =~ /^if the \S+ is (\w+), what colour is it\?$/
132 2 55 if ($lq =~ /^how many colours in the list (.*?)\?$/ or $lq =~ /^the list (.*?) contains how many colours\?$/ or $lq =~ /^(.*?): how many colours in the list\?$/)
138 2 50 if ($lq =~ /^which of these is a colour: (.*?)\?$/ or $lq =~ /^which of (.*?) is a colour\?$/ or $lq =~ /^(.*?): the colour is\?$/ or $lq =~ /^the colour in the list (.*?) is\?$/)
145 1 46 if ($lq =~ /^what is the (?

\d+)\S+ colour in the list (?.*?)\?$/ or $lq =~ /^the (?

\d+)\S+ colour in (?.*?) is\?$/ or $lq =~ /^(?.*?): the (?

\d+)\S+ colour is\?$/)

153 2 42 if ($lq =~ /^the number of body parts in the list (.*?) is\?$/ or $lq =~ /^the list (.*?) contains how many body parts\?$/ or $lq =~ /^(.*?): how many body parts in the list\?$/)
159 2 36 if ($lq =~ /^the body part in (.*?) is\?$/ or $lq =~ /^which of these is a body part: (.*?)\?$/ or $lq =~ /^which of (.*?) is a body part\?$/ or $lq =~ /^which of (.*?) is part of a person\?$/ or $lq =~ /^(.*?): the body part is\?$/)
167 3 33 if ($lq =~ /^(.*?) is part of the head\?$/)
170 3 30 if ($lq =~ /^(.*?) is something each person has more than one of\?$/)
173 3 27 if ($lq =~ /^(.*?) is above the waist\?$/)
176 3 24 if ($lq =~ /^(.*?) is below the waist\?$/)
181 1 23 if ($lq =~ /^enter the number (.*?) in digits:$/ or $lq =~ /^what is (.*?) as (?:digits|a number)\?$/)
186 3 19 if ($lq =~ /^which digit is (?

\d+)\S+ in the number (?\d+)\?$/ or $lq =~ /^what is the (?

\d+)\S+ digit in (?\d+)\?$/ or $lq =~ /^in the number (?\d+), what is the (?

\d+)\S+ digit\?$/)

190 1 3 $+{'p'} > length $+{'n'} ? :
192 2 14 if ($lq =~ /^the (?

\d+)\S+ number from (?.*?) is\?$/ or $lq =~ /^what is the (?

\d+)\S+ number in the list (?.*?)\?$/ or $lq =~ /^what number is (?

\d+)\S+ in the series (?.*?)\?$/ or $lq =~ /^(?.*?): the (?

\d+)\S+ number is\?$/)

201 2 9 if ($lq =~ /^enter the $biggest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $biggest_re\?$/ or $lq =~ /^which of (.*?) is the $biggest_re\?$/ or $lq =~ /^(.*?): which of these is the $biggest_re\?$/ or $lq =~ /^(.*?): the $biggest_re is\?$/)
210 2 4 if ($lq =~ /^enter the $smallest_re number of (.*?):$/ or $lq =~ /^of the numbers (.*?), which is the $smallest_re\?$/ or $lq =~ /^which of (.*?) is the $smallest_re\?$/ or $lq =~ /^(.*?): which of these is the $smallest_re\?$/ or $lq =~ /^(.*?): the $smallest_re is\?$/)
218 4 0 if ($lq =~ /^(.*?) (?:= |equals |is what)\?$/ or $lq =~ /^what(?:'s| is) (.*?)\?$/)
224 4 0 if $expr =~ /^[ \d+-]+$/