in reply to Devel::Cover, Testing, 100%?!

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.

If it were me I would remove the second test. Why check for data that you have already checked is valid?

Replies are listed 'Best First'.
Re^2: Devel::Cover, Testing, 100%?!
by Crian (Curate) on Jun 08, 2004 at 10:48 UTC
    I would delete the obsolete second test.

    If you don't want to remove it, then comment out the first check (in the first programm), so you get garbage into your second program and your error-case will be testet.

    Or just put a "1 or" in front of your if-expression to test the output from your error-message.

    But you cannot create a testsuit covering all cases, if you have redundant testcode.