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
Comments
From @jkeenanThis is a bug report for perl from jkeenan@cpan.org, During the DuckDuckGo hackathon (http://act.yapc.eu/ddg2012/), I had This fork enabled me to study Pod::Html's source code and tests. As I The attached patch is written, I believe, so that it can be added to the Thank you very much. Flags: 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: Locally applied patches: @INC for perl 5.16.0: Environment for perl 5.16.0: DYLD_LIBRARY_PATH=/Users/jimk/work/pseudoinstall/lib:/Users/jimk/gitwork/parrot/blib/lib 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 |
From @jkeenant_anchorify.patchdiff --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__
|
The RT System itself - Status changed from 'new' to 'open' |
@tonycoz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#113926 (status was 'resolved')
Searchable as RT113926$
The text was updated successfully, but these errors were encountered: