Skip Menu |

This queue is for tickets about the Test-Output CPAN distribution.

Report information
The Basics
Id: 72976
Status: resolved
Priority: 0/
Queue: Test-Output

People
Owner: Nobody in particular
Requestors: dmuey [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: not all STDOUT is caught
Hello brian! If the &writer prints it catches it fine: [dmuey@multivac ~]$ perl -MTest::More=tests,1 -MTest::Output -e 'diag("perl v$] Mod v$Test::Output::VERSION");stdout_is(sub {print "howdy"},"howdy","print()");' 1..1 # perl v5.010000 Mod v1.01 ok 1 - print() [dmuey@multivac ~]$ If the &writer does system(), the system() output is not caught: [dmuey@multivac ~]$ perl -MTest::More=tests,1 -MTest::Output -e 'diag("perl v$] Mod v$Test::Output::VERSION");stdout_is(sub {system("echo howdy")},"howdy","system()");' 1..1 # perl v5.010000 Mod v1.01 howdy not ok 1 - system() # Failed test 'system()' # at -e line 1. # STDOUT is: # # not: # howdy # as expected # Looks like you failed 1 test of 1. [dmuey@multivac ~]$
I think the problem is the basic design of the module. The tie stuff isn't going to handle things in subprocesses. Now that Capture::Tiny has implemented my ticket to capture its streams separately, I could probably re-do this module. However, I don't have much use for it at the moment, especially in this case. It just took over the module; I didn't invent it. If someone wants to preserve the interface but redo the internals, you can either send patches or pull requests, or even take over the module.
Removing the tie and using Capture::Tiny fixes this problem. Thanks,