Skip Menu |

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

Report information
The Basics
Id: 11250
Status: resolved
Priority: 0/
Queue: XML-Twig

People
Owner: Nobody in particular
Requestors: rdhayes [...] ucla.edu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.15
Fixed in: 3.16



Subject: test_additional fails on Redhat 8 install attempt
Hi, I am attempting to install XML::Twig 3.15 and I am reporting this because it is similar to other reports here, but the fixes there did not help. For example, version 3.16 downloaded from http://www.xmltwig.com failed with different problems. # uname -a Linux localhost.localdomain 2.4.18-14smp #1 SMP Wed Sep 4 12:34:47 EDT 2002 i686 i686 i386 GNU/Linux # perl -v This is perl, v5.8.0 built for i386-linux-thread-multi # perl Makefile.PL Do you want to install 'xml_pp' (XML pretty printer)? [y] y Do you want to install 'xml_grep' (XML grep - grep XML files using XML::Twig's subset of XPath)? [y] y Do you want to install 'xml_spellcheck' (spellcheck XML files skipping tags)? [y] y Checking if your kit is complete... Looks good Writing Makefile for XML::Twig # make echo "building Twig.pm" building Twig.pm /usr/bin/perl speedup Twig.pm.slow > Twig.pm perl version is 5.008 XML::Parser version is 2.34 /usr/bin/perl check_optional_modules cp Twig.pm blib/lib/XML/Twig.pm cp Twig/XPath.pm blib/lib/XML/Twig/XPath.pm cp tools/xml_grep/xml_grep blib/script/xml_grep /usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/xml_grep cp tools/xml_pp/xml_pp blib/script/xml_pp /usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/xml_pp cp tools/xml_spellcheck/xml_spellcheck blib/script/xml_spellcheck /usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/xml_spellcheck Manifying blib/man3/XML::Twig.3pm Manifying blib/man1/xml_grep.1 Manifying blib/man1/xml_pp.1 Manifying blib/man1/xml_spellcheck.1 # make test echo "building Twig.pm" building Twig.pm /usr/bin/perl speedup Twig.pm.slow > Twig.pm perl version is 5.008 XML::Parser version is 2.34 /usr/bin/perl check_optional_modules Skip blib/lib/XML/Twig.pm (unchanged) Skip blib/lib/XML/Twig/XPath.pm (unchanged) PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/is_field..........................ok t/pod...............................ok t/test1.............................ok t/test2.............................ok t/test3.............................ok t/test4.............................ok t/test5.............................ok t/test_additional...................complex substitution with subs_text: expected: '<doc><p>see <a href="http://www.xmltwig.com">www.xmltwig.com</a> but do not link to http://bad.com, though link to toto and see <a href="http://www.xml.com">www.xml.com</a></p><p>now http://www.nolink.com and do not link to this and do not link to http://www.bad.com and do not link to http://www.bad2.com and see <a href="http://link.com">link.com</a> also</p></doc>' got : '<doc><p>see <a href="http://"></a>www.xmltwig.com but do not link to http://bad.com, though link to toto and see <a href="http://www.xml.com">www.xml.com</a></p><p>now http://www.nolink.com and do not link to this and do not link to http://www.bad.com and do not link to http://www.bad2.com and see <a href="http://"></a>link.com also</p></doc>' : skipping 2 tests need Unicode::Map8 and Unicode::String for those tests: skipping 3 tests t/test_additional...................FAILED test 284 Failed 1/646 tests, 99.85% okay t/test_attregexp_cond...............ok t/test_cdata........................ok t/test_class_methods................ok t/test_comment_handler..............ok t/test_drop_comments................ok t/test_entities.....................ok t/test_erase........................ok t/test_errors.......................ok t/test_expand_external_entities.....ok t/test_ignore_elts..................ok t/test_nav..........................ok t/test_need_io_scalar...............ok t/test_need_use_bytes...............: skipping 2 tests Use of uninitialized value in addition (+) at t/test_need_use_bytes.t line 136. Use of uninitialized value in addition (+) at t/test_need_use_bytes.t line 136. Use of uninitialized value in addition (+) at t/test_need_use_bytes.t line 140. t/test_need_use_bytes...............ok t/test_pi_handler...................ok t/test_pos..........................ok t/test_simplify.....................Name "XML::Simple::PREFERRED_PARSER" used only once: possible typo at t/test_simplify.t line 22. t/test_simplify.....................ok t/test_spaces.......................ok t/test_twig_roots...................ok t/test_unique_xpath.................ok t/test_variables....................ok t/test_with_lwp.....................ok 2/13 ### warning is normal here ### t/test_with_lwp.....................ok 3/13file:test_with_lwp_no_file.xml File `test_with_lwp_no_file.xml' does not exist at t/test_with_lwp.t line 40 t/test_with_lwp.....................ok t/test_xpath_cond...................ok t/xmlxpath_01basic..................ok t/xmlxpath_02descendant.............ok t/xmlxpath_03star...................ok t/xmlxpath_04pos....................ok t/xmlxpath_05attrib.................ok t/xmlxpath_06attrib_val.............ok t/xmlxpath_07count..................ok t/xmlxpath_08name...................ok t/xmlxpath_09a_string_length........ok t/xmlxpath_09string_length..........ok t/xmlxpath_10pipe...................ok t/xmlxpath_12axisdescendant.........ok t/xmlxpath_13axisparent.............ok t/xmlxpath_14axisancestor...........ok t/xmlxpath_15axisfol_sib............ok t/xmlxpath_16axisprec_sib...........ok t/xmlxpath_17axisfollowing..........ok t/xmlxpath_18axispreceding..........ok t/xmlxpath_19axisd_or_s.............ok t/xmlxpath_20axisa_or_s.............ok t/xmlxpath_21allnodes...............ok t/xmlxpath_22name_select............ok t/xmlxpath_23func...................ok t/xmlxpath_24namespaces.............ok t/xmlxpath_25scope..................ok t/xmlxpath_26predicate..............ok t/xmlxpath_28ancestor2..............ok t/xmlxpath_29desc_with_predicate....ok t/xmlxpath_30lang...................ok t/xmlxpath_additional...............ok t/xmlxpath_nav......................ok t/xmlxpath_test1....................ok t/xmlxpath_test_twig_roots..........ok t/xmlxpath_test_with_handlers.......ok t/xmlxpath_xpath_cond...............ok t/zz_dump_config.................... Configuration: perl: 5.008 OS: linux - i686-linux XML::Parser : 2.34 expat : 1.95.5 Scalar::Util : 1.14 Encode : 2.09 LWP : 5.803 HTML::Entities : 1.29 Tie::IxHash : 1.21 XML::XPath : 1.13 Test : 1.25 Test::Pod : 1.20 XML::Simple : 2.13 XML::Handler::YAWriter : 0.23 XML::SAX::Writer : 0.44 IO::Scalar : 2.105 Please add this information to bug reports (you can run t/zz_dump_config.t to get it) t/zz_dump_config....................ok Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/test_additional.t 646 1 0.15% 284 Failed 1/66 test scripts, 98.48% okay. 1/1738 subtests failed, 99.94% okay. make: *** [test_dynamic] Error 29
[guest - Wed Jan 26 19:38:30 2005]: Show quoted text
> I am attempting to install XML::Twig 3.15 and I am reporting this > because it is similar to other reports here, but the fixes there > did not help. For example, version 3.16 downloaded from > http://www.xmltwig.com failed with different problems. > > This is perl, v5.8.0 built for i386-linux-thread-multi
[...] Show quoted text
> t/test_additional...................complex substitution with > subs_text: > expected: '<doc><p>see <a > href="http://www.xmltwig.com">www.xmltwig.com</a> but do not link > to http://bad.com, though link to toto and see <a > href="http://www.xml.com">www.xml.com</a></p><p>now > http://www.nolink.com and do not link to this and do not link to > http://www.bad.com and do not link to http://www.bad2.com and see > <a href="http://link.com">link.com</a> also</p></doc>' > got : '<doc><p>see <a href="http://"></a>www.xmltwig.com but do > not link to http://bad.com, though link to toto and see <a > href="http://www.xml.com">www.xml.com</a></p><p>now > http://www.nolink.com and do not link to this and do not link to > http://www.bad.com and do not link to http://www.bad2.com and see > <a href="http://"></a>link.com also</p></doc>'
Show quoted text
> perl: 5.008 > OS: linux - i686-linux
[...] Hi, I have seen reports of this, but I dont remember ever being able to re-create it. I just tried with perl-5.8.0, not multi-threaded though, on Mandrake, and the test passed. I don't see anything in the code being exercized by the test that would depend on the version of Perl/Twig/any other module. It involves a bit of regexp action, but nothing really complex. If I find some time I will try again using a multi-threaded version of 5.8.0, but I would actually be more interested in knowing what problems you had with version 3.16. Thank you -- Mirod
[MIROD - Fri Jan 28 12:21:48 2005]: Show quoted text
> Hi, > > I have seen reports of this, but I dont remember ever being able to > re-create it. I just tried with perl-5.8.0, not multi-threaded though, > on Mandrake, and the test passed. I don't see anything in the code
being Show quoted text
> exercized by the test that would depend on the version of
Perl/Twig/any Show quoted text
> other module. It involves a bit of regexp action, but nothing really > complex. > > If I find some time I will try again using a multi-threaded version of > 5.8.0, but I would actually be more interested in knowing what
problems Show quoted text
> you had with version 3.16. > > Thank you
Hello again, I poked around at the test, and my specific problems seem to be related to the regular expression class in test_additional.t on line 825: qr{(?<!do not )link to (http://([^\s,]*))} The [^\s,]* construct appears to be matching and returning the empty string in my installed Perl, leading to the failed test output above. If I change this class to the equally valid (for testing purposes) [A- Za-z0-9.]* class, then make test passes and a double check of $got- Show quoted text
>print and $expected through warn statements show the correct parsing.
If this all looks kosher to you (i.e. - strange test code behaviour rather than a bug in XML::Twig itself), I am happy to consider this bug closed and go ahead with the install. I will post a bug for the 3.16 build separately, as requested. Thanks!
[guest - Fri Jan 28 17:16:21 2005]: Show quoted text
> I poked around at the test, and my specific problems seem to be related > to the regular expression class in test_additional.t on line 825: > qr{(?<!do not )link to (http://([^\s,]*))} > > The [^\s,]* construct appears to be matching and returning the empty > string in my installed Perl, leading to the failed test output above. > > If I change this class to the equally valid (for testing purposes) [A- > Za-z0-9.]* class, then make test passes and a double check of $got-
> >print and $expected through warn statements show the correct parsing.
> > If this all looks kosher to you (i.e. - strange test code behaviour > rather than a bug in XML::Twig itself), I am happy to consider this bug > closed and go ahead with the install.
This sounds good. Did you test with with [^\s,]+ If that works, then I would rather use this, in the unlikely event that someone uses the tests as an exemple. Thanks a lot for debugging this, I appreciate. Show quoted text
> I will post a bug for the 3.16 build separately, as requested.
Excellent, thanks __ Mirod
[MIROD - Sat Jan 29 02:43:38 2005]: Show quoted text
> > This sounds good. Did you test with with [^\s,]+ If that works, then
I Show quoted text
> would rather use this, in the unlikely event that someone uses the
tests Show quoted text
> as an exemple. >
I took a cue from the source of HTML::FromText and altered the line 825 of t/test_additional.t to: my $got= $t->subs_text( qr{(?<!do not )link to (http://(\S+ [\w/]))}, 'see &elt( a =>{ href => $1 }, $2)'); which will now match anything non-whitespace that ends in a word character or a slash. It's not quite the most robust URL matching scheme, but will serve as a simpler and better example than my original fix. Show quoted text
> Thanks a lot for debugging this, I appreciate. >
You're welcome!
[guest - Mon Jan 31 02:07:36 2005]: Show quoted text
> I took a cue from the source of HTML::FromText and altered the line 825 > of t/test_additional.t to: > > my $got= $t->subs_text( qr{(?<!do not )link to (http://(\S+ > [\w/]))}, 'see &elt( a =>{ href => $1 }, $2)'); > > which will now match anything non-whitespace that ends in a word > character or a slash. It's not quite the most robust URL matching > scheme, but will serve as a simpler and better example than my original > fix.
Thanks, applied __ Mirod