in reply to How do you Test that the right output got printed?

I can't think of a good reason to have a method that doesn't have a return value, except maybe a little less typing for the developer. If you don't care what the return value is, just don't check it outside of your test suite.

Personally, I like the first reply best - just return the value to be printed and do your printing outside the sub. That will give the method-user the most flexibility in how they incorporate that method into their own programs.
  • Comment on Re: How do you Test that the right output got printed?