From: Paul Marquess <paul.marquess@btinternet.com>
Date: Sun, 29 Oct 2006 21:03:21 +0000 (+0000)
Subject: A new regression test from:
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=19d9c0e45bf900f576aa43d944ccfe4aebd3f678;p=p5sagit%2Fp5-mst-13.2.git

A new regression test from:

Subject: [PATHCH]  Scalar::Util::readonly &  compression (was RE: Change 29117: [PATCH] IO::Compress modules)
From: "Paul Marquess" <paul.marquess@ntlworld.com>
Message-ID: <02cf01c6fb9d$ade808a0$6501a8c0@myopwv.com>

p4raw-id: //depot/perl@29261
---

diff --git a/ext/List/Util/t/readonly.t b/ext/List/Util/t/readonly.t
index a515f2e..7415759 100644
--- a/ext/List/Util/t/readonly.t
+++ b/ext/List/Util/t/readonly.t
@@ -14,7 +14,7 @@ BEGIN {
 }
 
 use Scalar::Util qw(readonly);
-use Test::More tests => 9;
+use Test::More tests => 11;
 
 ok( readonly(1),	'number constant');
 
@@ -36,3 +36,14 @@ ok( !readonly($var),	'reference to constant');
 ok( readonly($$var),	'de-reference to constant');
 
 ok( !readonly(*STDOUT),	'glob');
+
+sub try
+{
+    my $v = \$_[0];
+    return readonly $$v;
+}
+
+$var = 123;
+ok( try ("abc"), 'reference a constant in a sub');
+ok( !try ($var), 'reference a non-constant in a sub');
+