Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Outputting input prompt with prove

by Tanktalus (Canon)
on Aug 05, 2019 at 03:44 UTC ( #11103905=note: print w/replies, xml ) Need Help??


in reply to Outputting input prompt with prove

That's because it's not your process that is buffering it. It's prove. I suspect it is reading line-by-line to be able to intersperse its own output without having stuff appear in funny places. But that means that because your "Enter" line doesn't have a line ending, prove thinks there is still more coming, and won't know you're done until it hits the \n, as there may be an ok(...) in there somewhere, and it needs to print that out properly should it happen.

That being said, I'm not sure why anything you expect to run under prove would be printing out partial lines or reading from STDIN. Both of those seem to be odd things to put in tests.

Replies are listed 'Best First'.
Re^2: Outputting input prompt with prove
by nysus (Parson) on Aug 05, 2019 at 05:37 UTC

    Iím not sure how I could avoid getting input from the user. Is there a way to inject input automatically?

      Did you write the test program? Then rewrite it so it doesn't need interactive input.

      If you didn't write the test program and cannot change it, don't use prove with it or learn that you need to type the input blindly.

      Maybe you can write a wrapper for test that writes the input you want to it and passes its output through, maybe using IPC::Run3.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11103905]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (1)
As of 2021-09-22 04:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?