[Israel.pm] problem with a test
xsawyerx at gmail.com
Thu Dec 27 00:47:59 PST 2012
On Thu, Dec 27, 2012 at 12:43 AM, moshe nahmias <moshegrey at ubuntu.com>wrote:
> As you know I write the mail stats program and started to write tests for
> it while I try to make it OO so nothing will break.
Awesome! That's a great reason to write tests!
> I wrote the input tests and there is a problem there, the last test which
> is supposed to get the data from the user via a file don't work well.
> It waits for a user input (even though only on the test and not while
> running the program, and using the same file for testing and when checking
> through the program).
I think you should separate getting the input from the user, and using that
input to do something.
That way you can test what needs to be done without checking input from the
You could also check the "getting input from user" subroutine separately
> I would like to know why it works on the full program but not on the test
> (isn't it supposed to be the same in this case?).
If I recall yesterday, you described the reason above. In the first test
you had you were not entering the input reading (my $input = <>), and on
the second test you were entering it, so it was hanging, waiting for input.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Perl