This looks like what `expect` / Expect.pm is made for. It talks to the unit under test, waiting for a string and answering with another one.
Refactoring the verification into subroutines might be the best long term solution. Do you know that your program never ever will use a different form of input? What if you need to verify e. g. XML file input?
In reply to Re: Pre-empting STDIN during Testing
by NiJo
in thread Pre-empting STDIN during Testing
by jkeenan1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |