|Do you know where your variables are?|
Suggestions for testing interactive CLI apps?by webfiend (Vicar)
|on Apr 21, 2010 at 05:41 UTC||Need Help??|
webfiend has asked for the
wisdom of the Perl Monks concerning the following question:
I've got a Web site heavily spiked with tutorials and sample code. The tutorial programs are very simple, and the user interaction is not what you'd consider demanding.
Given a simple Parrot PIR program like this:
The sample usage is straightforward, but bothersome to double-check every time I update my Parrot install.
$ parrot code/example-01-06.pir Please enter your name: Brian Hello, Brian!
Manually verifying behavior after a language update has become tiresome. So I wrote some tests. They use IO::Pty::Easy to handle input and output.
There's nothing wrong with this code - at least nothing that is obvious to me. I'm just wondering if there is a test approach or IO library preferred by the monks for testing lots of simple scripts of this nature.
Edit: Added the Parrot script being tested to hopefully improve the coherence of my late night post.