diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-09-10 21:18:00 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-09-14 11:49:38 +0200 |
commit | 89fa4092e9eb4b2c39ef338275abc7f5949befd1 (patch) | |
tree | 01146ba1ea9ec732b48343e1bcdff3845f3625fd /dist/Storable | |
parent | 6797988b273c1f95c01750967b12cf4be188cdbf (diff) | |
download | perl-89fa4092e9eb4b2c39ef338275abc7f5949befd1.tar.gz |
Change Storable's code.t to serialise a subroutine under our control.
The test originally testing serialising and deserialising \&Test::ok. When
the test was converted from Test.pm to Test::More in 2009, it was changed to
use \&Test::More::ok. However, this turns out to be "works on my machine".
Test::More::ok from Test::Simple 0.61 onwards (2005, b1ddf16980125497) will
deserialise correctly. The previous implementation of Test::More::ok uses a
lexical from an outer scope. Hence the textual representation of the
subroutine (in isolation) fails to deserialise, because it's not valid under
strict, because there is no visible declaration of the lexical.
Hence switch to testing a large subroutine under our control, _store(), to
avoid unpleasant surprises from dependencies we were not even aware of.
The comment "large scalar" dates from the original test using \&Test::ok.
It's not clear which large scalar it refers to.
Diffstat (limited to 'dist/Storable')
-rw-r--r-- | dist/Storable/t/code.t | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dist/Storable/t/code.t b/dist/Storable/t/code.t index 687a6d1e44..c383142d5a 100644 --- a/dist/Storable/t/code.t +++ b/dist/Storable/t/code.t @@ -60,7 +60,7 @@ local *FOO; \&Another::Package::foo, # code in another package sub ($$;$) { 0 }, # prototypes sub { print "test\n" }, - \&Test::More::ok, # large scalar + \&Storable::_store, # large scalar ], {"a" => sub { "srt" }, "b" => \&code}, |