I built the aging but probably still-useful module extension HTML::Tidy this week (and, oi, that was an adventure) and it is failing one test. Built it using/for StrawberryPerl. I inserted blank lines in the screen output pasted below, for easier reading.

$ perl -T -Iblib/lib -Iblib/arch t/clean.t not ok 3 - $tidy->clean("") returns empty HTML document # Failed test '$tidy->clean("") returns empty HTML document' # at t/clean.t line 20. # '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> # <html> # <head> # <meta name="generator" content="tidyp for Windows (v1.04), see www.w +3.org"> # <title></title> # </head> # <body> # </body> # </html> # ' # doesn't match '(?^:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2// +EN"> # <html> # <head> # <meta name="generator" content="[^"]+"> # <title></title> # </head> # <body> # </body> # </html> # )' Looks like you failed 1 test of 3.

My perl is this:

  Platform:
    osname=MSWin32
    osvers=10.0.22631.5189
    archname=MSWin32-x64-multi-thread
    uname='Win32 strawberry-perl 5.40.2.1 # 05:42:50 Sun May 11 2025 x64'
    

Can anyone explain Andy's intent in how he coded that test? Thanks all.

Sep 19, 2025 at 22:28 UTC


In reply to Let's play 'explain the error' in test suite for HTML::Tidy by Intrepid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.