end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

/usr/bin/cpanm XML::Atom for perl で error

$ perl -v
This is perl 5, version 26, subversion 3 (v5.26.3)

$ sudo /usr/bin/cpanm XML::Atom
     :
XML::Atom 31-external-entities-libxml.t

t/30-datetime-stringification.t .. skipped: DateTime and DateTime::Format::Atom are required for tests

#   Failed test 'resolved entity'
#   at t/31-external-entities-libxml.t line 57.
#                   '<p>No, Ben isn't updating. It's me testing out guest author functionality.</p>'
#     doesn't match '(?^:This is what you get when you do unit testing)'
# Looks like you failed 1 test of 4.
t/31-external-entities-libxml.t .. 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/4 subtests 
# XPath Override in place
Constant subroutine XML::Atom::LIBXML redefined at t/31-external-entities-xpath.t line 18.
External Entities disabled. at /root/.cpanm/work/1606830522.134077/XML-Atom-0.42/blib/lib/XML/Atom.pm line 
52.
t/31-external-entities-xpath.t ... ok

という、error が発生

https://github.com/miyagawa/xml-atom/issues/18

を見ると、test script の t/31-external-entities-libxml.t において 以下のように修正すると、OKらしい。

old) my $libxml=XML::LibXML->new;
new) my $libxml=XML::LibXML->new(expand_xinclude=>1,expand_entities=>1,load_ext_dtd=>1);

ただ、今回、cpanm で installしていますので 「sudo /usr/bin/cpanm --force XML::Atom」のように「--force」でinstallしました。