develooper Front page | perl.perl5.porters | Postings from April 2012

RE: [perl #111936] Storable - storing 'code' test failure

Thread Next
From:
samuel.ferencik
Date:
April 23, 2012 03:45
Subject:
RE: [perl #111936] Storable - storing 'code' test failure
Message ID:
66607689AF9BB243B6C00BC05B4AFE6E0D97D40EDD@LDNPCMMGMB05.INTRANET.BARCAPINT.COM
> Actually, I can’t reproduce this at all.  The t/code.t that comes with
> Storable 2.30 doesn’t try to freeze Test::More::ok at all.  So I can
> only ask where this distribution came from.  And was it really 2.30?

It is Storable 2.30 from CPAN. Are you running it on Perl 5.8.5 on Linux? (I've also tried 5.8.8 on both Linux and Windows, and t/code.t passed.) 

Here is how I'm running it; the failure is reproducible consistently:

    .../src$ perl t/code.t
    1..63
    ok 1
    ok 2
    ...
    ok 42
    ok 43
    Variable "$Test" is not imported at (eval 79) line 5.
    not ok 44
    #     Failed test (t/code.t at line 269)
    #          got: 'code sub ($;$) {
    #     package Test::More;
    #     use strict 'refs';
    #     my($test, $name) = @_;
    #     $Test->ok($test, $name);
    # } caused an error: Global symbol "$Test" requires explicit package name at (eval 79) line 5, at t/code.t line 268
    # '
    #     expected: ''
    not ok 45
    #     Failed test (t/code.t at line 272)
    not ok 46
    #     Failed test (t/code.t at line 272)
    not ok 47
    #     Failed test (t/code.t at line 272)
    not ok 48
    #     Failed test (t/code.t at line 272)
    not ok 49
    #     Failed test (t/code.t at line 272)
    ok 50
    ok 51
    ...
    ok 62
    ok 63
    # Looks like you failed 6 tests of 63.

My version of code.t has this:

  56 @obj =
  57     ([\&code,                   # code reference
  58       sub { 6*7 },
  59       $blessed_code,            # blessed code reference
  60       \&Another::Package::foo,  # code in another package
  61       sub ($$;$) { 0 },         # prototypes
  62       sub { print "test\n" },
  63       \&Test::More::ok,               # large scalar
  64      ],
...
 267     $freezed = freeze $obj[0];
 268     eval { $thawed  = thaw $freezed };
 269     is($@, "");

Test::More::ok is frozen as $obj[0]->[6] on line 267, and the subsequent thawing fails on line 269.

Is your source different?

Sam

_______________________________________________

This e-mail may contain information that is confidential, privileged or otherwise protected from 
disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute 
it by any means. Please delete it and any attachments and notify the sender that you have received 
it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a 
solicitation to buy or sell any securities, investment products or other financial product or 
service, an official confirmation of any transaction, or an official statement of Barclays. Any 
views or opinions presented are solely those of the author and do not necessarily represent those 
of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. 
By messaging with Barclays you consent to the foregoing.  Barclays offers premier investment banking 
products and services to its clients through Barclays Bank PLC, a company registered in England 
(number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP.  This email may 
relate to or be sent from other members of the Barclays Group.

_______________________________________________

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About