Re: Test failure: manpage writer

"G. Branden Robinson" <[email protected]>
Newsgroups gmane.text.docutils.devel
Message-ID <20231103195426.y6thwmnrg7codsjl@illithid>
Hi Guenter,

I'm CCing you because it seems like everytime I post to this list, I get
a bounce telling me I'm not subscribed.  But I am...

At 2023-11-03T18:15:33-0000, Guenter Milde via Docutils-develop wrote:
> Dear Engelbert,
> 
> running the test suite with r9464 resulted in a failure
> 
> FAIL: test_publish (test_writers.test_manpage.WriterPublishTestCase)
>       (id="totest['table'][0]")
[...]
> It this the intended output?
> Is it tested with groff?

The output of groff in 1.23.0 changed slightly here.

Here's some 1.22.4/1.23.0 comparison on my system.  UTF-8 output
follows.

$ /usr/bin/nroff -v
GNU nroff (groff) version 1.22.4
$ nroff -v
GNU nroff (groff) version 1.23.0
GNU groff version 1.23.0
Copyright (C) 2022 Free Software Foundation, Inc.
GNU groff comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of groff and its subprograms
under the terms of the GNU General Public License.
For more information about these matters, see the file
named COPYING.

called subprograms:

GNU grotty (groff) version 1.23.0
GNU troff (groff) version 1.23.0

First let's look at how the original table exhibit is handled.

$ cat /tmp/docu.man
.TH foo 1 2023-11-03 "groff test suite"
.SH Name
foo \- frobnicate a bar
.TS
center;
|l|l|.
_
T{
head
T}      T{
and
T}
_
T{
1
T}      T{
2
T}
_
T{
abc
T}      T{
so
T}
_
.TE

$ /usr/bin/nroff -t -man /tmp/docu.man
foo(1)                      General Commands Manual                     foo(1)



Name
       foo - frobnicate a bar
                                    ┌─────┬─────┐
                                    │head │ and │
                                    ├─────┼─────┤
                                    │1    │ 2   │
                                    ├─────┼─────┤
                                    │abc  │ so  │
                                    └─────┴─────┘



groff test suite                  2023‐11‐03                            foo(1)
$ nroff -t -man /tmp/docu.man
foo(1)                      General Commands Manual                     foo(1)

Name
       foo - frobnicate a bar
                                   ┌──────┬─────┐
                                   │ head │ and │
                                   ├──────┼─────┤
                                   │ 1    │ 2   │
                                   ├──────┼─────┤
                                   │ abc  │ so  │
                                   └──────┴─────┘

groff test suite                  2023‐11‐03                            foo(1)

Notice:

A.  Fewer blank lines in the output after the page header; and
B.  There is now a space after the left border of the table.

With your patch, let see what we get.

$ cat /tmp/docu2.man
.TH foo 1 2023-11-03 "groff test suite"
.SH Name
foo \- frobnicate a bar
.TS
box center;
l|l.
T{
head
T}      T{
and
T}
_
T{
1
T}      T{
2
T}
_
T{
abc
T}      T{
so
T}
.TE
$ /usr/bin/nroff -t -man /tmp/docu2.man
foo(1)                      General Commands Manual                     foo(1)



Name
       foo - frobnicate a bar
                                    ┌─────┬─────┐
                                    │head │ and │
                                    ├─────┼─────┤
                                    │1    │ 2   │
                                    ├─────┼─────┤
                                    │abc  │ so  │
                                    └─────┴─────┘


groff test suite                  2023‐11‐03                            foo(1)
$ nroff -t -man /tmp/docu2.man
foo(1)                      General Commands Manual                     foo(1)

Name
       foo - frobnicate a bar
                                   ┌──────┬─────┐
                                   │ head │ and │
                                   ├──────┼─────┤
                                   │ 1    │ 2   │
                                   ├──────┼─────┤
                                   │ abc  │ so  │
                                   └──────┴─────┘

groff test suite                  2023‐11‐03                            foo(1)

Notice again:

A.  Fewer blank lines in the output after the page header; and
B.  There is now a space after the left border of the table.

I fixed several bugs in table formatting for terminal devices in groff
1.23.0, and while I was at it I made the box border handling more
consistent.

Here's the relevant commit.

commit 8f066786ea3cb5e1dbade1149e7d50ae978da202
Author: G. Branden Robinson <[email protected]>
Date:   Fri Feb 3 02:22:02 2023 -0600

    [tbl]: Improve symmetry of tables in nroff mode.

    * src/preproc/tbl/table.cpp (table::compute_column_positions): If a
      table has "left separation" (it is boxed, or has a vertical rule on
      the left-hand side), increase the first column's start register value
      by 1n, for symmetry with the right-hand size.

    * src/preproc/tbl/tests/check-horizontal-line-length.sh:
    * src/preproc/tbl/tests/check-line-intersections.sh:
    * src/preproc/tbl/tests/check-vertical-line-length.sh: Update output
      expectations.

    * src/preproc/tbl/tbl.am (tbl_XFAIL_TESTS): Remove now-passing test.

    Before:

    +--+---+---+
    |a | b | c |
    +--+---+---+
    |d | e | f |
    +--+---+---+
    |g | h | i |
    +--+---+---+

    After:

    +---+---+---+
    | a | b | c |
    +---+---+---+
    | d | e | f |
    +---+---+---+
    | g | h | i |
    +---+---+---+

Further, if you want a table where every cell is boxed, that's what the
"allbox" option is for.  You can use that instead of putting "|" in your
row descriptions and adding rows consisting solely of "_".

tbl(1):
     allbox          Enclose each table entry in a box; implies box.

Regards,
Branden
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmVFT+oACgkQ0Z6cfXEm
bc7aUQ/8Do4+NZw7ofgy1f5w7ZOZn+97nFMdG2z9EQq6R9bS6EOyvD9qqk26nklC
K9EyGwgmaynCcCWYEd9Mhh/z8LpofZoPEkIdocC447ikzJ0ILNgnQk6LTL70e2Q1
YdnKfnxk3GOzlnMpJMBDpnYzHtam07IlEdw2WSTc1fQ05sy/P2mAs3bnxCtPVjgO
euPD1YYzwSAQfTH47rIFH+Q8WHHO9xy8j7FpwfxIrBQwDq1KgP6s9MfMlW+1XKfX
O9F00dYtZKm+g77ftiA2U6ITGaLmoHnjl0UoYn0E8NEisKh8JUC75khPuqrS4mTR
uJk47v4TtYbud/94X6O5hs1sV6a+L/NacN/baei3HWa4+vFfqsFc8vyEpsSMGvk9
oRFEqCrOGZX1fz5aYrEekeXUXwddzP2TCJq/S4H45zQKslLrICibyZhhU7jVcluw
HZWVJ1nfzih3nZhEPCwF9+HV96N4WFFgbMIIUgWG8m4XFrAOaViXFTs9nW3lkCrc
eTUA3UcCda1xZshYOmhW8J5CBY7rk1F3neqJUNxMo/MiDvtvWZO7X21BlJmTj+xw
YHUou8kzqEQCBJD7wMGCDmqochvnOHRHwc9Wx3cMuVs5pbzxZ7aD1gMcTmbEL+G9
DRsc2VeG8rxfunDz0akZOscxr6j+s3T8rPnDYJD4/1zVs1hGCTY=
=5T8Y
-----END PGP SIGNATURE-----
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.