I used the word "misuse" because I think that the Test::* modules were originally used for testing code, and I've adapted them to some orthogonal uses.
At it's most fundamental, you just need to define a set of "things" you want to test and define their acceptable output. This can be tricky, as you might need to define a range of acceptable output values. One strategy that I've used in the past is to predefine a hash like this:
%commands = {
$cmd1 => $output1, ...
};
Then execute the commands and test the dynamic output against the predefined output.
I've actually got to run and catch a plane, but I'll be sure to check on this thread when I get back. Cheers. :) |