Subject: | [PATCH] Fix up tests for imminent bleadperl changes |
I am about to apply the attached patch to bleadperl as part of a branch that changes the way constants are handled.
Constant folding is documented in perlop as having no side-effects. But actually it does have side-effects, in that \"abc" will return a read-only scalar, whereas \$abc returns a mutable scalar.
My branch fixes that (without eliminating the folding, though).
IO::Compress’s tests expect \"abc" to return a read-only scalar, so I just skipped the tests in question based on the version.
Subject: | open_wPxgh4tc.txt |
From 39e8e695a253bd1a4dc5ea023266a1f5a1e26bad Mon Sep 17 00:00:00 2001
From: Father Chrysostomos <sprout@cpan.org>
Date: Thu, 25 Jul 2013 00:32:49 -0700
Subject: [PATCH] Fix up IO::Compress tests
They were expecting \"abc" to return a constant value, but constant
folding no longer causes \ to return a read-only scalar.
diff --git a/cpan/IO-Compress/t/01misc.t b/cpan/IO-Compress/t/01misc.t
index 150fb69..6a6ad8c 100644
--- a/cpan/IO-Compress/t/01misc.t
+++ b/cpan/IO-Compress/t/01misc.t
@@ -79,6 +79,9 @@ sub My::testParseParameters()
like $@, mkErr("Parameter 'fred' not writable"),
"wanted writable, got readonly";
+ skip '\\ returns mutable value in 5.19.3', 1
+ if $] >= 5.019003;
+
eval { ParseParameters(1, {'fred' => [Parse_writable_scalar, 0]}, fred => \'abc') ; };
like $@, mkErr("Parameter 'fred' not writable"),
"wanted writable, got readonly";
diff --git a/cpan/IO-Compress/t/compress/oneshot.pl b/cpan/IO-Compress/t/compress/oneshot.pl
index 14309ab..43c8dce 100644
--- a/cpan/IO-Compress/t/compress/oneshot.pl
+++ b/cpan/IO-Compress/t/compress/oneshot.pl
@@ -183,7 +183,7 @@ sub run
use Config;
skip 'readonly + threads', 1
- if $Config{useithreads};
+ if $Config{useithreads} || $] >= 5.019003;
eval { $a = $Func->(\$in, \$out, TrailingData => \"abc") ;} ;