in reply to Re: (jeffa) Re: RFC: Seconds2English
in thread RFC: Seconds2English

First off, read chromatic's Introduction to Testing article at perl.com if you already haven't.

You test your interface and make sure that you get the expected results. Tests for the items that you mentioned are 'user errors' ... you write validation code for that instead. While i am sure that is possible to incorporate such 'contracts' into a test suite ... i am not sure that they belong there. Probably better is to pass some function an argument that would cause an illegal division by 0, and then test that the right error code or message was returned instead.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)