Skip Menu |

This queue is for tickets about the Test-MockObject CPAN distribution.

Report information
The Basics
Id: 84535
Status: resolved
Priority: 0/
Queue: Test-MockObject

People
Owner: Nobody in particular
Requestors: HALKEYE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.20120301
Fixed in: 1.20140328



Subject: Object based on fields breaks with perl at least 5.10
Trying to upgrade some old 5.8 unit tests to a 5.10 install. I've run into a snag with objects based on fields. I've attached a simple test case. Running it for me gives "Modification of a read-only value attempted" I'm really not sure what the proper solution to this is.
Subject: test-mockobject-extends-usecase.pl
#!/usr/bin/env perl package MyModule; use strict; use warnings; use fields qw(field1 field2); sub new { my $self = shift; unless (ref $self) { $self = fields::new($self); } return $self; } package main; use strict; use warnings; use Test::MockObject::Extends; use Data::Dumper; my $VAR1 = MyModule->new(); print Data::Dumper::Dumper($VAR1); my $VAR2 = Test::MockObject::Extends->new($VAR1);
Subject: Re: [rt.cpan.org #84535] AutoReply: Object based on fields breaks with perl at least 5.10
Date: Tue, 9 Apr 2013 16:15:44 -0700
To: bug-Test-MockObject [...] rt.cpan.org
From: Gavin <halkeye [...] gmail.com>
I've found this workaround from http://www.nntp.perl.org/group/perl.perl5.porters/2006/12/msg119016.html It looks like fields object locks the fields. I'm going to try to create a patch. On Tue, Apr 9, 2013 at 10:54 AM, Bugs in Test-MockObject via RT < bug-Test-MockObject@rt.cpan.org> wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "Object based on fields breaks with perl at least 5.10", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #84535]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=84535 > > Please include the string: > > [rt.cpan.org #84535] > > in the subject line of all future correspondence about this issue. To do > so, > you may reply to this message. > > Thank you, > bug-Test-MockObject@rt.cpan.org > > ------------------------------------------------------------------------- > Trying to upgrade some old 5.8 unit tests to a 5.10 install. I've run into > a snag with objects based on fields. > > I've attached a simple test case. Running it for me gives "Modification of > a read-only value attempted" > > I'm really not sure what the proper solution to this is. > >
CC: HALKEYE [...] cpan.org
Subject: Re: [rt.cpan.org #84535] AutoReply: Object based on fields breaks with perl at least 5.10
Date: Tue, 9 Apr 2013 17:22:18 -0700
To: bug-Test-MockObject [...] rt.cpan.org
From: Gavin <halkeye [...] gmail.com>
Added a pull request - https://github.com/chromatic/Test-MockObject/pull/4 On Tue, Apr 9, 2013 at 4:15 PM, Gavin via RT < bug-Test-MockObject@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=84535 > > > I've found this workaround from > http://www.nntp.perl.org/group/perl.perl5.porters/2006/12/msg119016.html > > It looks like fields object locks the fields. I'm going to try to create a > patch. > > > On Tue, Apr 9, 2013 at 10:54 AM, Bugs in Test-MockObject via RT < > bug-Test-MockObject@rt.cpan.org> wrote: >
> > > > Greetings, > > > > This message has been automatically generated in response to the > > creation of a trouble ticket regarding: > > "Object based on fields breaks with perl at least 5.10", > > a summary of which appears below. > > > > There is no need to reply to this message right now. Your ticket has
> been
> > assigned an ID of [rt.cpan.org #84535]. Your ticket is accessible > > on the web at: > > > > https://rt.cpan.org/Ticket/Display.html?id=84535 > > > > Please include the string: > > > > [rt.cpan.org #84535] > > > > in the subject line of all future correspondence about this issue. To do > > so, > > you may reply to this message. > > > > Thank you, > > bug-Test-MockObject@rt.cpan.org > > > > ------------------------------------------------------------------------- > > Trying to upgrade some old 5.8 unit tests to a 5.10 install. I've run
> into
> > a snag with objects based on fields. > > > > I've attached a simple test case. Running it for me gives "Modification
> of
> > a read-only value attempted" > > > > I'm really not sure what the proper solution to this is. > > > >
> >
RT-Send-CC: halkeye [...] gmail.com
Resolved in 1.20140328. Thanks for reporting!
RT-Send-CC: halkeye [...] gmail.com
Le 2014-03-29 00:23:05, CHROMATIC a écrit : Show quoted text
> Resolved in 1.20140328. Thanks for reporting!
Unfortunately the "fix" raises a warning which breaks my tests using Test::NoWarnings: Name ...::FIELDS used only once: possible typo at ... I'm testing on Perl 5.10.1. I'm investigating and will open another issue... -- Olivier Mengué - http://perlresume.org/DOLMEN