This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In t/op/eval.t, move logic from a spawned program into the main test script.
authorNicholas Clark <nick@ccl4.org>
Mon, 14 Mar 2011 15:07:12 +0000 (15:07 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 14 Mar 2011 19:09:48 +0000 (19:09 +0000)
commit0d804ff61f3a2df265fee122d53e0463dac6f878
treec4c6ee38d8b3b7650798a369ae7c6b2be188be8b
parent49801ec2d7060531b93111303ad5de74c09e8b2d
In t/op/eval.t, move logic from a spawned program into the main test script.

This also allows a chunk of it to be removed. There's no need inside a spawned
script to

a: dup STDERR so that it can be restored
b: open STDERR to a temporary file
c: call Devel::Peek::Dump
d: close the temporary file
e: restore STDERR
f: open it for reading
g: manipulate the contents
h: return ok/not ot

when instead we can run step 'c' only, with STDERR captured, perform step 'g'
only in the main script, and finish with an is() test instead of an ok()
This also saves having to substitute a generated temporary filename into the
code for the spawned script.

[Collateral "damage" is converting the next test to use test.pl's is()]
t/op/eval.t