summaryrefslogtreecommitdiff
path: root/t/op/eval.t
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2003-06-15 23:09:03 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-06-16 22:47:28 +0000
commitf48583aa2d2b7c9a2c44c530083c6fdd7e6f9713 (patch)
tree5b20dd4504fecf6c06b69728fc2294ace4fbe3c8 /t/op/eval.t
parent168696769693b5e65a30c0a0a677c7f648e8370e (diff)
downloadperl-f48583aa2d2b7c9a2c44c530083c6fdd7e6f9713.tar.gz
Revert change #19126, a poor attempt at fixing bug #21742.
The test for #21742 is marked as TODO. Plus new regression tests from : Subject: [perl #22708] void context in string eval is broken From: "Marcus Holland-Moritz" (via RT) <perlbug-followup@perl.org> Message-ID: <rt-22708-59432.14.6755501393177@rt.perl.org> p4raw-link: @19126 on //depot/perl: a89be09a10c36299e755a956d356eb7f1f643437 p4raw-id: //depot/perl@19801
Diffstat (limited to 't/op/eval.t')
-rwxr-xr-xt/op/eval.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/t/op/eval.t b/t/op/eval.t
index a6d78c4dbd..6aef5b88e5 100755
--- a/t/op/eval.t
+++ b/t/op/eval.t
@@ -5,7 +5,7 @@ BEGIN {
@INC = '../lib';
}
-print "1..88\n";
+print "1..91\n";
eval 'print "ok 1\n";';
@@ -422,3 +422,19 @@ $test++;
sub Foo {} print Foo(eval {});
print "ok ",$test++," - #20798 (used to dump core)\n";
+
+# check for context in string eval
+{
+ my(@r,$r,$c);
+ sub context { defined(wantarray) ? (wantarray ? ($c='A') : ($c='S')) : ($c='V') }
+
+ my $code = q{ context() };
+ @r = qw( a b );
+ $r = 'ab';
+ @r = eval $code;
+ print "@r$c" eq 'AA' ? "ok " : "# '@r$c' ne 'AA'\nnot ok ", $test++, "\n";
+ $r = eval $code;
+ print "$r$c" eq 'SS' ? "ok " : "# '$r$c' ne 'SS'\nnot ok ", $test++, "\n";
+ eval $code;
+ print $c eq 'V' ? "ok " : "# '$c' ne 'V'\nnot ok ", $test++, "\n";
+}