mulander has asked for the wisdom of the Perl Monks concerning the following question:
Hello fellow Monks.
I am wondering how can one test a subroutine that requires input from STDIN somewhere in the middle of the sub.
I searched for some function that could test such a sub in Test::More but did not found any that could let me scheduele what to input when the test sees <STDIN>. I just want to queue the input that normally a user would type in, so the test can run without the tester substituting the user. Maybe any one could guide me where to search for such a sub, or should I test it in another way?
Edited by planetscape - formatting and s/subrutine/subroutine/;
2005-10-28 Retitled by planetscape, as per Monastery guidelines
Original title: 'Re: Testing a subrutine with STDIN'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Testing a subroutine with STDIN
by calin (Deacon) on Oct 28, 2005 at 15:30 UTC | |
|
Testing a subroutine with STDIN
by sauoq (Abbot) on Oct 28, 2005 at 14:40 UTC | |
|
Re: Testing a subroutine with STDIN
by liz (Monsignor) on Oct 28, 2005 at 19:22 UTC | |
|
Re: Testing a subroutine with STDIN
by xdg (Monsignor) on Oct 28, 2005 at 17:54 UTC |