So let's see what are the failure conditions here:=item addgroup Takes one parameter, which may optionally be named 'group'. We detect whether it is a named parameter or not by checking for the presence of 'group' followed by anything else in the arguments. This should be a valid groupname (ie consists solely of word characters) which does not exist. If that's OK, an empty group is created. All errors are fatal.
There is one way of succeeding - if none of the above apply, an empty group is created. And if any of the above apply, we die().
I want to do as much as I can to automate the writing of my tests. Clearly, I can't automate writing tests for success, but I feel that I should be able to at least go part of the way towards automating tests for failure.
I would like to embed those tests in the POD in such a way that I can use a tool to both spew out a skeleton for the tests to which I can later add tests for success and for any other failure conditions which can't be easily specified (eg, in this case the test for "user specified a group that already exists"); and also the same data that was used to generate those tests will also generate human-readable documentation. I'm prepared to accept human-readable docs that are somewhat stilted.
There is already Test::Inline on the CPAN, but that doesn't go far enough - it lets me write my tests inline with the POD, but does not attempt to generate them automagically.
I'd like feedback on whether people think this is a good idea, and on the sort of syntax I should use.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Automatic generation of tests
by flyingmoose (Priest) on Feb 23, 2004 at 14:12 UTC | |
by DrHyde (Prior) on Feb 23, 2004 at 14:40 UTC | |
by adrianh (Chancellor) on Feb 23, 2004 at 15:33 UTC | |
by DrHyde (Prior) on Feb 24, 2004 at 09:44 UTC | |
by adrianh (Chancellor) on Feb 25, 2004 at 11:54 UTC | |
| |
by Anonymous Monk on Feb 23, 2004 at 15:03 UTC | |
by adrianh (Chancellor) on Feb 23, 2004 at 15:23 UTC | |
by Anonymous Monk on Feb 23, 2004 at 18:41 UTC | |
by adrianh (Chancellor) on Mar 05, 2004 at 15:35 UTC | |
by flyingmoose (Priest) on Feb 23, 2004 at 17:12 UTC | |
by adrianh (Chancellor) on Feb 23, 2004 at 17:21 UTC | |
by Anonymous Monk on Feb 23, 2004 at 19:10 UTC | |
by adrianh (Chancellor) on Mar 05, 2004 at 15:58 UTC | |
| |
|
Re: Automatic generation of tests
by tachyon (Chancellor) on Feb 28, 2004 at 11:16 UTC |