Re: Phalanx

2005-03-31 Thread Sébastien Aperghis-Tramoni
Selon Gabor Szabo <[EMAIL PROTECTED]>: > > So I guess my question is, what exactly am I supposed to do to improve > > test coverage? Am I supposed to modify the existing scripts so they > > execute more functions exported by the module? Are any of the other > > modules currently being tested not u

a less fragile way to test when we need to read and write to STDOUT?

2005-03-31 Thread Mark Stosberg
Hello, I've been working on a Perl test suite for darcs, with notable recent help from Schwern. We used to have tests that looked like this: like(`echo y | darcs command`,qr/$re/); That would run the command and answer "y" to the first and only question it asked. It worked well enough, but

Re: a less fragile way to test when we need to read and write to STDOUT?

2005-03-31 Thread Michael G Schwern
On Thu, Mar 31, 2005 at 04:46:22PM +, Mark Stosberg wrote: > We used to have tests that looked like this: > >like(`echo y | darcs command`,qr/$re/); > > That would run the command and answer "y" to the first and only question > it asked. It worked well enough, but I looked for for a pure

Re: a less fragile way to test when we need to read and write to STDOUT?

2005-03-31 Thread Mark Stosberg
On 2005-04-01, Michael G Schwern <[EMAIL PROTECTED]> wrote: >> commands with Perl? > > When using open2 you have to be careful to close WRITE before you READ so > the program does not hang waiting for more input. Once you've fixed that > the technique above should be just fine. > > sub echo { >

Re: a less fragile way to test when we need to read and write to STDOUT?

2005-03-31 Thread Michael G Schwern
On Fri, Apr 01, 2005 at 03:17:38AM +, Mark Stosberg wrote: > > sub echo { > > my($input, $command) = @_; > > > > local(*READ, *WRITE); > > open2(*READ, *WRITE, "$DARCS $command"; > > print WRITE "a\n"; > > Thanks for the tip. On this line, did you mean to write > >