| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# Copyright 2020 G. Branden Robinson |
| 4 |
# |
| 5 |
# This file is part of groff, the GNU roff typesetting system. |
| 6 |
# |
| 7 |
# groff is free software; you can redistribute it and/or modify it under |
| 8 |
# the terms of the GNU General Public License as published by the Free |
| 9 |
# Software Foundation, either version 3 of the License, or |
| 10 |
# (at your option) any later version. |
| 11 |
# |
| 12 |
# groff is distributed in the hope that it will be useful, but WITHOUT |
| 13 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 14 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 15 |
# for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
# |
| 20 |
|
| 21 |
groff="${abs_top_builddir:-.}/test-groff" |
| 22 |
|
| 23 |
fail= |
| 24 |
|
| 25 |
wail () { |
| 26 |
echo ...FAILED >&2 |
| 27 |
fail=YES |
| 28 |
} |
| 29 |
|
| 30 |
# Regression-test Savannah #59246. |
| 31 |
# |
| 32 |
# andoc should remove mdoc(7) traps before rendering a man(7) page. |
| 33 |
# Continuous rendering has to be _off_ to catch this. |
| 34 |
# |
| 35 |
# We also deliberately omit a fourth argument to the man(7) TH call to |
| 36 |
# sniff out a stale footer component from mdoc(7). |
| 37 |
|
| 38 |
input='.Dd October 11, 2020 |
| 39 |
.Dt mdoc\-test 7 |
| 40 |
.Os |
| 41 |
.Sh Name |
| 42 |
.Nm mdoc\-test |
| 43 |
.Nd lay mine |
| 44 |
.Sh Description |
| 45 |
Just testing. |
| 46 |
.TH man\-test 7 2020-10-12 |
| 47 |
.SH Name |
| 48 |
man-test \- drive sheep across minefield |
| 49 |
.SH Description |
| 50 |
\[lq]doc\-footer\[rq] should definitely not be sprung by this document.' |
| 51 |
|
| 52 |
output=$(printf "%s\n" "$input" \ |
| 53 |
| "$groff" -Tascii -P-cbou -rC1 -rcR=0 -mandoc) |
| 54 |
echo "$output" |
| 55 |
|
| 56 |
echo 'checking for correct mdoc(7) footer on first document' >&2 |
| 57 |
echo "$output" | grep -Eqx 'GNU +October 11, 2020 +1' || wail |
| 58 |
|
| 59 |
echo 'checking for correct man(7) footer on second document' >&2 |
| 60 |
echo "$output" | grep -Eqx ' +2020-10-12 +2' || wail |
| 61 |
|
| 62 |
test -z "$fail" |
| 63 |
|
| 64 |
# vim:set ai et sw=4 ts=4 tw=72: |