Don't ask to ask, just ask | |
PerlMonks |
prompt and timeout in testsby leocharre (Priest) |
on Jan 15, 2008 at 21:43 UTC ( [id://662561]=perlquestion: print w/replies, xml ) | Need Help?? |
leocharre has asked for the wisdom of the Perl Monks concerning the following question: I have this sub to prompt the user for a response.
(I guess what I'm missing is some kind of a counter, because the thing hangs waiting for stdin forever.. Maybe I could force to read stdin every 1 second, and thus I can count time.. but that would possibly yank the user's input before they concede, which is brutal. hmm.. ) I want to use this in tests, so that if there's no human being I can go on as needed. Are there some special precautions I should take when retrieving user input in my tests? I know they're picky about stdout (Test::Simple), right? I want to optionally conduct intrusive tests (for example connecting to a database during testing ), defaulting to no. update Is there a major CAVEAT? Like, only runs on POSIX (muahhaha)? Is this kind of check reliable?
Back to
Seekers of Perl Wisdom
|
|