Subject: | XML::Twig indented_c complains about Text::Wrap |
Ciao mirod,
it seems that Text::Wrap isn't loaded correctly when using XML::Twig.
I haven't dug the source, but I've prepared a test file with the output
I get in my platform (linux) and perl (5.8.8 without threads). Let me
know if you need more information about my setup.
Ciao,
Flavio.
Subject: | xmltwig-pretty.t |
# vim: filetype=perl :
use strict;
use warnings;
use Test::More tests => 4; # last test to print
use Test::Exception;
use XML::Twig;
my $twig;
lives_ok {
$twig = XML::Twig->new(pretty_print => 'indented_c');
} 'twig creation lives';
lives_ok {
my $doc = '<whatever><indented>Hello, world!</indented></whatever>';
$twig->parse($doc)
} 'twig parsing lives';
lives_ok {
local *STDOUT;
$twig->print();
} 'twig printing lives';
lives_ok {
local *STDOUT;
require Text::Wrap;
$twig->print();
} 'twig printing lives after requiring Text::Wrap';
__END__
xmltwig-pretty......
1..4
ok 1 - twig creation lives
ok 2 - twig parsing lives
not ok 3 - twig printing lives
# Failed test 'twig printing lives'
# at xmltwig-pretty.t line 23.
# died: Undefined subroutine &Text::Wrap::wrap called at /opt/perl-5.8.8/lib/site_perl/5.8.8/XML/Twig.pm line 7729.
ok 4 - twig printing lives after requiring Text::Wrap
# Looks like you failed 1 test of 4.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/4 subtests
Test Summary Report
-------------------
xmltwig-pretty.t (Wstat: 256 Tests: 4 Failed: 1)
Failed test: 3
Non-zero exit status: 1
Files=1, Tests=4, 0 wallclock secs ( 0.00 usr 0.00 sys + 0.02 cusr 0.10 csys = 0.12 CPU)
Result: FAIL