Pod::Simple doesn't warn when the text of a definition =item matches /[\*\d]/; and a fix to this bug

[email protected] (Marc Green)
Newsgroups perl.pod-people
Message-ID <CAAL1P-HfR6hFV=ArjxdkpY0-oHX7PPy06TWZas72GaxCqFTdXQ@mail.gmail.com>
Hello Pod People,

When given the following input, Pod::Simple does not warn that the [text]
portion of the 2nd and 3rd =item is invalid.

=over

=item a definition

some text

=item *

a bullet

=item 1

a number

=back

According to perlpodsepc,

The "=item [text]" paragraph should not match
m/\A=item\s+\d+\.?\s*\z/<http://perldoc.perl.org/functions/m.html>or
m/\A=item\s+\*\s*\z/ <http://perldoc.perl.org/functions/m.html>, nor should
it match just m/\A=item\s*\z/ <http://perldoc.perl.org/functions/m.html>.

I am not sure why it doesn't warn in this situation, but does warn for
other =item type mismatches.

I wrote a simple patch to fix this,
https://github.com/marcgreen/pod-simple/commit/ca07e53f8ab50087d01e5b8063e70fd291e7a670,
but this makes a test fail in t/items.t (included are two commented
out
test cases, which I ask about later on):

print "#\n# Test for mixed =item blocks...\n";
ok( $x->_out("\n=over\n\n=item Foo\n\nStuff\n\n=item 2.\n\nBar
I<baz>!\n\nQuux\n\n=item *\n\nThwoong\n\n=back\n\n"),
    qq{<Document><over-text
indent="4"><item-text>Foo</item-text><Para>Stuff</Para>}
  . qq{<item-text>2.</item-text><Para>Bar
<I>baz</I>!</Para><Para>Quux</Para>}
  . qq{<item-text>*</item-text><Para>Thwoong</Para></over-text></Document>}
);

# ok( $x->_out("\n=over\n\n=item *\n\nStuff\n\n=item 2.\n\nBar
I<baz>!\n\nQuux\n\n=item *\n\nThwoong\n\n=back\n\n"),
# ok( $x->_out("\n=over\n\n=item 1.\n\nStuff\n\n=item 2.\n\nBar
I<baz>!\n\nQuux\n\n=item *\n\nThwoong\n\n=back\n\n"),

It fails because the expected result does not include the newly generated
warning message:

<head1 errata=\"1\">POD ERRORS</head1><Para errata=\"1\">Hey! <B>The above
document had some coding errors, which are explained
below:</B></Para><over-text errata=\"1\" indent=\"4\"><item-text>Around
line 13:</item-text><Para>Expected text matching /\\s+[^\\*\\d]/ after
&#39;=item&#39;</Para></over-text>

I can patch the test case too, but I am not sure if that would be desired.
Why are the test cases immediately below the one that fails commented out?
They would be testing the other =item type mismatches (and the warning that
is generated for each) if they were uncommented and complete.

Does anyone have any objection to me hardcoding the generated error message
in the expected results?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.