Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod::Html::anchorify() and htmlify() are not tested #12236

Closed
p5pRT opened this issue Jul 1, 2012 · 5 comments
Closed

Pod::Html::anchorify() and htmlify() are not tested #12236

p5pRT opened this issue Jul 1, 2012 · 5 comments
Labels
distro-All ext/Pod-Html issues in the blead-upstream Pod-Html distribution type-library

Comments

@p5pRT
Copy link

p5pRT commented Jul 1, 2012

Migrated from rt.perl.org#113926 (status was 'resolved')

Searchable as RT113926$

@p5pRT
Copy link
Author

p5pRT commented Jul 1, 2012

From @jkeenan

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.

During the DuckDuckGo hackathon (http​://act.yapc.eu/ddg2012/), I had
occasion to discuss
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=113740 with Rik Signes.
He mentioned that one likely approach to the long-term maintenance of
Pod​::Html would be to dual-life it, i.e., to transfer its maintenance to
CPAN. Anticipating that, I copied the source code and tests for
Pod​::Html from blead into a github repository, a copy of which can be
found here​:
https://github.com/jkeenan/Pod-Html.

This fork enabled me to study Pod​::Html's source code and tests. As I
customarily do, I performed coverage analysis using Devel​::Cover. When
I did so, I noticed that Pod​::Html​::anchorify() was not exercised during
the test suite. Since Pod​::Html​::htmlify() is used only within
anchorify it, too, was implicitly untested.

The attached patch is written, I believe, so that it can be added to the
Pod​::Html test suite in the Perl 5 core distribution. Please review.

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

@p5pRT
Copy link
Author

p5pRT commented Jul 1, 2012

From @jkeenan

t_anchorify.patch
diff --git a/t/anchorify.t b/t/anchorify.t
new file mode 100644
index 0000000..96b7e14
--- /dev/null
+++ b/t/anchorify.t
@@ -0,0 +1,96 @@
+# -*- perl -*-
+use strict;
+use Pod::Html qw( anchorify );
+use Test::More tests => 1;
+
+my @filedata;
+{
+    local $/ = '';
+    @filedata = <DATA>;
+}
+
+my (@poddata, $i, $j);
+for ($i = 0, $j = -1; $i <= $#filedata; $i++) {
+    $j++ if ($filedata[$i] =~ /^\s*=head[1-6]/);
+    if ($j >= 0) {
+        $poddata[$j]  = "" unless defined $poddata[$j];
+        $poddata[$j] .= "\n$filedata[$i]" if $j >= 0;
+    }
+}
+
+my %heads = ();
+foreach $i (0..$#poddata) {
+    $heads{anchorify($1)} = 1 if $poddata[$i] =~ /=head[1-6]\s+(.*)/;
+}
+my %expected = map { $_ => 1 } qw(
+    name
+    description
+    subroutine
+    error
+    method
+    has_a_wordspace
+    hastrailingwordspace
+    hasleadingwordspace
+    has_extra_internalwordspace
+    hasquotes
+    hasquestionmark
+    has_hyphen_and_space
+);
+is_deeply(
+    [ keys %heads ],
+    [ keys %expected ],
+    "Got expected POD heads"
+);
+
+__DATA__
+=head1 NAME
+
+anchorify - Test C<Pod::Html::anchorify()>
+
+=head1 DESCRIPTION
+
+alpha
+
+=head2 Subroutine
+
+beta
+
+=head3 Error
+
+gamma
+
+=head4 Method
+
+delta
+
+=head4 Has A Wordspace
+
+delta
+
+=head4 HasTrailingWordspace  
+
+epsilon
+
+=head4    HasLeadingWordspace
+
+zeta
+
+=head4 Has	Extra  InternalWordspace
+
+eta
+
+=head4 Has"Quotes"
+
+theta
+
+=head4 Has?QuestionMark
+
+iota
+
+=head4 Has-Hyphen And Space
+
+kappa
+
+=cut
+
+__END__

@p5pRT
Copy link
Author

p5pRT commented Jun 24, 2013

From @tonycoz

On Sun Jul 01 12​:50​:55 2012, jkeen@​verizon.net wrote​:

The attached patch is written, I believe, so that it can be added to
the
Pod​::Html test suite in the Perl 5 core distribution. Please review.

Thanks, applied as 1022acf

@p5pRT
Copy link
Author

p5pRT commented Jun 24, 2013

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jun 24, 2013

@tonycoz - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Jun 24, 2013
@jkeenan jkeenan added the ext/Pod-Html issues in the blead-upstream Pod-Html distribution label Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distro-All ext/Pod-Html issues in the blead-upstream Pod-Html distribution type-library
Projects
None yet
Development

No branches or pull requests

2 participants