Branch Coverage

blib/lib/RTF/Tokenizer.pm
Criterion Covered Total %
branch 80 90 88.8


line true false branch
113 5 32 if ($config{'file'}) { }
21 11 elsif ($config{'string'}) { }
165 2 10 if (ref $file eq 'GLOB') { }
1 9 elsif (eval { do { $file->isa('IO::File') } }) { }
4 5 elsif (ref $file eq 'IO::Scalar') { }
4 1 elsif (not ref $file) { }
167 1 1 unless $$self{'_FILEHANDLE'}
186 1 3 unless $$self{'_FILEHANDLE'}
210 20 0 if defined $line
222 12 0 if ($temp_buffer =~ /(\cM\cJ|\cM|\cJ)/) { }
225 4 8 if $$self{'_IRS'} eq "\r"
226 1 11 if $$self{'_IRS'} eq "\r\n"
227 7 5 if $$self{'_IRS'} eq "\n"
289 2 3004 if ($$self{'_BINARY_DATA'})
297 3 3001 if ($$self{'_PUT_TOKEN_CACHE_FLAG'})
314 124 2912 if ($start_character =~ /[^\\{}\r\n]/) { }
2619 293 elsif ($start_character eq '\\') { }
118 175 elsif ($start_character eq '{') { }
120 55 elsif ($start_character eq '}') { }
21 34 elsif (not $start_character) { }
326 100 31 if defined $1
334 7 124 if (not $$self{'_BUFFER'} and $$self{'_FILEHANDLE'})
336 7 0 if $$self{'_BUFFER'}
354 2 2615 if ($$self{'_TEMP_ESCAPE_FLAG'}) { }
371 20 1 unless $$self{'_FILEHANDLE'}
375 0 1 if $$self{'_FILEHANDLE'}->eof
377 0 1 unless $$self{'_BUFFER'}
396 17 2886 if $$token[0] eq 'eof'
435 1 1 if ($bool) { }
464 1 3 if (@_)
500 30 2589 if ($$self{'_BUFFER'} =~ s/^\*//) { }
2569 20 elsif ($$self{'_BUFFER'} =~ s/ ^([a-z]{1,32}) # Lowercase word (-?\d+)? # Optional signed number (?:\s|(?=[^a-z0-9])) # Either whitespace, which we gobble or a # non alpha-numeric, which we leave //xi) { }
7 13 elsif ($$self{'_BUFFER'} =~ s/^'([0-9a-f]{2})//i) { }
1 12 elsif ($$self{'_BUFFER'} =~ s/^([-_~:|{}'\\])//) { }
3 9 elsif ($$self{'_BUFFER'} =~ s/^[\r\n]//) { }
0 9 elsif ($$self{'_BUFFER'} =~ s/^\t//) { }
0 9 elsif ($$self{'_BUFFER'} =~ s/^\;//) { }
4 5 elsif ($$self{'_BUFFER'} =~ s/^u(\d+)//) { }
2 6 elsif ($$self{'_SLOPPY'} and $$self{'_BUFFER'} =~ s/^([a-z]{1,32})(-?\d+)//i) { }
515 1414 1155 if defined $2
516 2565 4 unless $1 eq 'bin'
524 1 6 if $$self{'_NOTE_ESCAPES'}
529 1 0 if $$self{'_NOTE_ESCAPES'}
556 2 0 if defined $2
586 2 0 if (not $$self{'_FILEHANDLE'} or $$self{'_FILEHANDLE'}->eof)