develooper Front page | perl.perl5.porters | Postings from July 2012

[perl #114126] Pod::Html: t/htmldir3.t test produces spurious pass

Thread Next
From:
James E Keenan
Date:
July 13, 2012 05:35
Subject:
[perl #114126] Pod::Html: t/htmldir3.t test produces spurious pass
Message ID:
rt-3.6.HEAD-11172-1342182919-329.114126-75-0@perl.org
# New Ticket Created by  James E Keenan 
# Please include the string:  [perl #114126]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=114126 >



This is a bug report for perl from jkeenan@cpan.org,
generated with the help of perlbug 1.39 running under perl 5.16.0.

In the course of working on my fork of Pod-Html, I have come to a point
where all the code has been refactored into an object-oriented interface
and where all the original tests (revised to have the OO interface) are
passing -- except one.

Further investigation suggests that the one failing test is *only
accidentally passing* in the test suite found in ext/Pod-Html/t/ in the
Perl 5 core distribution.

You can see this for yourself by cd-ing to ext/Pod-Html/ in blead.
Call:

#####
prove -Ilib t/*.t
#####

All tests should pass.

Now, copy into ext/Pod-Html/t/ the two files attached to this RT:
xhtmldir3.t and yhtmldir3.t.  xhtmldir3.t simply removes the first of
two invocations of the testing function convert_n_test() from
xhtmldir3.t.  yhtmldir3.t switches the order of those two invocations of
convert_n_test().

If all the tests and testing functions were well
formulated in the first place, you would expect all tests to pass.  Now
call:

#####
prove -Ilib t/*.t
#####

The sole test in xhtmldir3.t and the first test in yhtmldir3.t should
now fail, with output like this:

#####
t/xhtmldir3.t .. 1/?
#   Failed test 'test --htmldir and --htmlroot 3b'
#   at t/pod2html-lib.pl line 78.
# --- htmldir3_expected.tmp     2012-07-12 13:15:14.000000000 -0400
# +++ /Users/jimk/gitwork/perl/ext/Pod-Html/t/htmldir3.html 
2012-07-12 13:15:14.000000000 -0400
# @@ -24,7 +24,7 @@
#
#  <p>Normal text, a <a>link</a> to nowhere,</p>
#
# -<p>a link to <a 
href="Users/jimk/gitwork/perl/ext/Pod-Html/testdir/test.lib/var-copy.html">var-copy</a>,</p>
# +<p>a link to <a>var-copy</a>,</p>
#
#  <p><a 
href="Users/jimk/gitwork/perl/ext/Pod-Html/t/htmlescp.html">htmlescp</a>,</p>
#
# Looks like you failed 1 test of 1.
t/xhtmldir3.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
t/yhtmldir3.t .. 1/2
#   Failed test 'test --htmldir and --htmlroot 3b'
#   at t/pod2html-lib.pl line 78.
# --- htmldir3_expected.tmp     2012-07-12 13:15:14.000000000 -0400
# +++ /Users/jimk/gitwork/perl/ext/Pod-Html/t/htmldir3.html 
2012-07-12 13:15:14.000000000 -0400
# @@ -24,7 +24,7 @@
#
#  <p>Normal text, a <a>link</a> to nowhere,</p>
#
# -<p>a link to <a 
href="Users/jimk/gitwork/perl/ext/Pod-Html/testdir/test.lib/var-copy.html">var-copy</a>,</p>
# +<p>a link to <a>var-copy</a>,</p>
#
#  <p><a 
href="Users/jimk/gitwork/perl/ext/Pod-Html/t/htmlescp.html">htmlescp</a>,</p>
#
t/yhtmldir3.t .. 2/2 # Looks like you failed 1 test of 2.
t/yhtmldir3.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests

Test Summary Report
-------------------
t/xhtmldir3.t (Wstat: 256 Tests: 1 Failed: 1)
   Failed test:  1
   Non-zero exit status: 1
t/yhtmldir3.t (Wstat: 256 Tests: 2 Failed: 1)
   Failed test:  1
   Non-zero exit status: 1
Files=19, Tests=37, 15 wallclock secs ( 0.36 usr  0.21 sys +  8.94 cusr 
  2.54 csys = 12.05 CPU)
Result: FAIL
#####

The differences between the expected HTML and the generated HTML which
are being reported are exactly the same as in the one failing test in my
github branch.

#####
# -<p>a link to <a 
href="Users/jimk/gitwork/perl/ext/Pod-Html/testdir/test.lib/var-copy.html">var-copy</a>,</p>
# +<p>a link to <a>var-copy</a>,</p>
#####

This suggests to me that the problem is in the way t/htmldir3.t is 
formulated.  My hunch is that the first test in t/htmldir3.t changes the 
environment in some way, not yet understood, that enables the second 
test to pass.  But when we make that test the first
one in a file, it fails.

Thank you very much.
Jim Keenan

---
Flags:
     category=library
     severity=low
     module=Pod::Html
---
Site configuration information for perl 5.16.0:

Configured by jimk at Sun May 20 20:01:26 EDT 2012.

Summary of my perl5 (revision 5 version 16 subversion 0) configuration:

   Platform:
     osname=darwin, osvers=8.11.0, archname=darwin-2level
     uname='darwin macintosh-8.local 8.11.0 darwin kernel version 
8.11.0: wed oct 10 18:26:00 pdt 2007; root:xnu-792.24.17~1release_ppc 
power macintosh powerpc '
     config_args='-des'
     hint=recommended, useposix=true, d_sigaction=define
     useithreads=undef, usemultiplicity=undef
     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
     use64bitint=undef, use64bitall=undef, uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing 
-pipe -I/usr/local/include -I/opt/local/include',
     optimize='-O3',
     cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe 
-I/usr/local/include -I/opt/local/include'
     ccversion='', gccversion='4.0.1 (Apple Computer, Inc. build 5250)', 
gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
     alignbytes=8, prototype=define
   Linker and Libraries:
     ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' 
-L/usr/local/lib -L/opt/local/lib'
     libpth=/usr/local/lib /opt/local/lib /usr/lib
     libs=-ldbm -ldl -lm -lc
     perllibs=-ldl -lm -lc
     libc=, so=dylib, useshrplib=false, libperl=libperl.a
     gnulibc_version=''
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
     cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup 
-L/usr/local/lib -L/opt/local/lib'

Locally applied patches:


---
@INC for perl 5.16.0:
     /usr/local/lib/perl5/site_perl/5.16.0/darwin-2level
     /usr/local/lib/perl5/site_perl/5.16.0
     /usr/local/lib/perl5/5.16.0/darwin-2level
     /usr/local/lib/perl5/5.16.0
     /usr/local/lib/perl5/site_perl/5.14.2
     /usr/local/lib/perl5/site_perl/5.14.0
     /usr/local/lib/perl5/site_perl/5.12.0
     /usr/local/lib/perl5/site_perl/5.10.1
     /usr/local/lib/perl5/site_perl/5.10.0
     /usr/local/lib/perl5/site_perl
     .

---
Environment for perl 5.16.0:
 
DYLD_LIBRARY_PATH=/Users/jimk/work/pseudoinstall/lib:/Users/jimk/gitwork/parrot/blib/lib
     HOME=/Users/jimk
     LANG (unset)
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
 
PATH=/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/Users/jimk/bin:/Users/jimk/bin/perl:/Users/jimk/bin/c:/Users/jimk/bin/shell:/sw/lib:/sw/bin:/Users/jimk/bin:/Users/jimk/bin/perl:/Users/jimk/bin/c:/Users/jimk/bin/shell:/sw/lib:/sw/bin
     PERL_BADLANG (unset)
     SHELL=/bin/bash

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About