From: Nicholas Clark Date: Sat, 1 Apr 2006 15:26:48 +0000 (+0000) Subject: Test that user pragmas work inside string eval. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f52edb181bf49efa81708ecd89186f642f0f2312;p=p5sagit%2Fp5-mst-13.2.git Test that user pragmas work inside string eval. p4raw-id: //depot/perl@27664 --- diff --git a/t/lib/mypragma.t b/t/lib/mypragma.t index b7a312c..a4c1177 100644 --- a/t/lib/mypragma.t +++ b/t/lib/mypragma.t @@ -7,7 +7,7 @@ BEGIN { use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 9; use mypragma (); # don't enable this pragma yet @@ -17,10 +17,17 @@ BEGIN { is(mypragma::in_effect(), undef, "pragma not in effect yet"); { + is(mypragma::in_effect(), undef, "pragma not in effect yet"); + eval qq{is(mypragma::in_effect(), undef, "pragma not in effect yet"); 1} + or die $@; + use mypragma; is(mypragma::in_effect(), 1, "pragma is in effect within this block"); + eval qq{is(mypragma::in_effect(), 1, + "pragma is in effect within this eval"); 1} or die $@; } is(mypragma::in_effect(), undef, "pragma no longer in effect"); +eval qq{is(mypragma::in_effect(), undef, "pragma not in effect"); 1} or die $@; BEGIN {