Branch: refs/heads/jkeenan/gh-16140-pod-html
  Home:   https://github.com/Perl/perl5
  Commit: 222f2b5050d7b9d22de8c4fc18b6943383e2fb37
      
https://github.com/Perl/perl5/commit/222f2b5050d7b9d22de8c4fc18b6943383e2fb37
  Author: James E Keenan <[email protected]>
  Date:   2021-02-01 (Mon, 01 Feb 2021)

  Changed paths:
    M ext/Pod-Html/t/pod2html-lib.pl

  Log Message:
  -----------
  Start refactoring convert_n_test()

This subroutine is used in Pod-Html's test suite.  Currently, it takes a
list of arguments in which:

        1: Root of name of test file in t/
        2: Test description displayed by harness
        3: List of command-line switches for 'pod2html',
           some of which may override default values

When debugging a function, it is useful to be able to dump the
function's arguments before we call the function, and to be able to do
so confidently that what we see in the dump is what we pass to the
function.

However, switches in the third position may silently override default
switches defined by convert_n_test.  That can make debugging a bit
murky.  Let's start by pulling the default switches into a lookup table.

For: GH 16140


  Commit: 85bcce841a0265ca17a223fb3c6c19f0af520c4e
      
https://github.com/Perl/perl5/commit/85bcce841a0265ca17a223fb3c6c19f0af520c4e
  Author: James E Keenan <[email protected]>
  Date:   2021-02-01 (Mon, 01 Feb 2021)

  Changed paths:
    M ext/Pod-Html/t/crossref.t
    M ext/Pod-Html/t/crossref2.t
    M ext/Pod-Html/t/crossref3.t
    M ext/Pod-Html/t/feature.t
    M ext/Pod-Html/t/feature2.t
    M ext/Pod-Html/t/htmldir1.t
    M ext/Pod-Html/t/htmldir2.t
    M ext/Pod-Html/t/htmldir3.t
    M ext/Pod-Html/t/htmldir4.t
    M ext/Pod-Html/t/htmldir5.t
    M ext/Pod-Html/t/htmlview.t
    M ext/Pod-Html/t/pod2html-lib.pl
    M ext/Pod-Html/t/podnoerr.t

  Log Message:
  -----------
  Make 3rd argument to convert_n_test a hash ref

Adapt all tests as needed to revised interface to convert_n_test().

Rationale:  convert_n_test is wrapper around pod2html(), which takes a
list of strings each of which is formatted like a command-line switch
(e.g., '--verbose', 'podpath=.').  A string so passed might override a
default value set within convert_n_test().  To be absolutely unambiguous
about what's being passed to pod2html(), we should make sure that a
value is passed to pod2html() only once for a given switch.

This requires a bit of footwork to account for flag switches, but will
facilitate debugging.  To get to that point, we revise convert_n_test()
to take a hashref as its third argument.


Compare: https://github.com/Perl/perl5/compare/222f2b5050d7%5E...85bcce841a02

Reply via email to