I'm having fun writing a test suite for my latest module. I just have one problem, I can't get to 100% coverage! My problem is basically thus: I have a function that takes input and does two operations.
The first operation iterates over the data and munges it in to the proper format, the second operation iterates over the correct format and does $stuff. My problem is, in the second operation I have a test for "bad data" while I'm iterating.
As far as I can tell, theres no possible way for this to happen, as the first step weeds out all the bad data and only passes "good" data to the second step. By "no possible way" I mean theres nothing I can think of to feed the function that will result in that second operation error message. As a result, that branch is never tested/called and I don't get to 100% coverage.
So my question is, do I remove that extra test so I get to 100% or just leave it in and live with 98.5%?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.