14.4. Conditional TestsIf you write tests directly from the specification before you've written the code, the tests are expected to fail. You can include some of your tests inside a TODO block to include them for test count but denote them as unavailable at the same time. For example, suppose you haven't taught your horses how to talk yet:
Here, the test is inside a TODO block, setting a package $TODO variable with the reason why the items are unfinished:[104]
Note that the TODO test counts toward the total number of tests. Also note that the message about why the test is a TODO test is displayed as a comment. The comment has a special form, noted by the test harness, so you will see it during a make test run. You can have multiple TODO tests in a given block, but only one reason per block, so it's best to group things that are related but use different blocks for different reasons.
Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|