Skip Menu |

This queue is for tickets about the XML-Simple CPAN distribution.

Report information
The Basics
Id: 102115
Status: resolved
Priority: 0/
Queue: XML-Simple

People
Owner: grantm [...] cpan.org
Requestors: CDRAKE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.20
Fixed in: 2.21



Subject: Build fails on fresh-install CentOS 6.5; Failed test 'Contents match expectations'
t/2_XMLout.t ............ 19/201 # Failed test 'Contents match expectations' # at t/2_XMLout.t line 535. # got: '' # expected: '<opt one="1" three="..." two="II" /> # ' # Looks like you failed 1 test of 201. t/2_XMLout.t ............ Dubious, test returned 1 (wstat 256, 0x100) Failed 1/201 subtests (less 1 skipped subtest: 199 okay)

Message body is not shown because it is too large.

Any idea why it fails? XML::Simple certainly used to work of Perl 5.10.1 and it hasn't been changed in years. My guess would be that something's going wrong with XML::SAX::PurePerl. Regards Grant On Fri Feb 13 19:04:29 2015, CDRAKE wrote: Show quoted text
> > t/2_XMLout.t ............ 19/201 > # Failed test 'Contents match expectations' > # at t/2_XMLout.t line 535. > # got: '' > # expected: '<opt one="1" three="..." two="II" /> > # ' > # Looks like you failed 1 test of 201. > t/2_XMLout.t ............ Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/201 subtests > (less 1 skipped subtest: 199 okay)
Subject: [rt.cpan.org #102115]
Date: Tue, 3 Mar 2015 16:31:09 +0100
To: <bug-XML-Simple [...] rt.cpan.org>
From: <F.Dreyer [...] telekom.de>
Show quoted text
> Any idea why it fails? XML::Simple certainly used to work of Perl 5.10.1 and it hasn't been changed in years. My guess would be that something's going wrong with XML::SAX::PurePerl.
If I insert a "die $@ if $@;" in line 534 of t/2_XMLout.t, I get this error: Can't locate object method "print" via package "FileHandle" at /root/.cpan/build/XML-Simple-2.20-jlst_l/blib/lib/XML/Simple.pm line 653 Since the test right above the failing test calls XMLout() with the same $hashref1 and succeeds, the xml generation itself seems to work fine but there seems to be something wrong with the way either t/2_XMLout.t or XML/Simple.pm interacts with FileHandle. But since I never directly used that module, I can't tell you what exactly causes the problem. Installed versions: CentOS 6.6 # Package Version # perl 5.10.1 # XML::Simple 2.20 # Storable 2.51 # XML::Parser 2.44 # XML::SAX 0.99 # XML::NamespaceSupport 1.11 # XML::SAX::Expat 0.51 (default parser) FileHandle 2.02 IO 1.25 IO::File 1.14 IO::Handle 1.28
I just hit this. Thanks for the clues! Add ing 'use FileHandle;' somewhere in t/2_XMLout.t fixes the test (by providing a print method for the filehandle)
Thanks for the report. I have tried to unsuccessfully to replicate the problem on CentOS 6.7 - I don't have access to an earlier version. XML::Simple does include logic to load the required classes to provide the print method on filehandles and I'm mystified as to why it doesn't work in these cases. So I've included the workaround suggested by Tim - adding 'use Filehandle' at the top of the test script. I've also removed some of the useless eval wrappers in the test script which would hide the root cause of errors. This fixes were included in 2.21. Regards Grant