[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 10/12: [ms]: Regression-test Savannah #66328.
From: |
G. Branden Robinson |
Subject: |
[groff] 10/12: [ms]: Regression-test Savannah #66328. |
Date: |
Mon, 14 Oct 2024 06:20:16 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 2f99042f7e1212e6fe37aa610e140dfded1d38f3
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Oct 13 15:05:45 2024 -0500
[ms]: Regression-test Savannah #66328.
* tmac/tests/s_XA-reduces-line-length.sh: Do it.
* tmac/tmac.am (tmac_TESTS): Run test.
Test fails at this commit.
---
ChangeLog | 7 +++
tmac/tests/s_XA-reduces-line-length.sh | 97 ++++++++++++++++++++++++++++++++++
tmac/tmac.am | 1 +
3 files changed, 105 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 5c4c9a144..5cf6fa846 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-10-13 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [ms]: Regression-test Savannah #66328.
+
+ * tmac/tests/s_XA-reduces-line-length.sh: Do it.
+ * tmac/tmac.am (tmac_TESTS): Run test.
+
2024-10-13 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/preproc/tbl/table.cpp (table::add_entry): Refactor. Since
diff --git a/tmac/tests/s_XA-reduces-line-length.sh
b/tmac/tests/s_XA-reduces-line-length.sh
new file mode 100755
index 000000000..1d10adafa
--- /dev/null
+++ b/tmac/tests/s_XA-reduces-line-length.sh
@@ -0,0 +1,97 @@
+#!/bin/sh
+#
+# Copyright (C) 2024 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+fail=
+
+wail () {
+ echo "...FAILED" >&2
+ fail=YES
+}
+
+# Regression-test Savannah #66328.
+
+input='.
+.ds C1 Chapter the First, \
+in which we Ramble On at Excessive Length for the Purpose of \
+Contriving a Table of Contents Entry So Garrulous That It Will Surely \
+Overrun the Line in Any Sensible Page Configuration\"
+.ds C2 Chapter the Second, \
+in which we Do Much the Same, \
+but Apply an Added Twist\"
+.ds C3 Of a Supplement for the Table of Contents, \
+Which in a Traditional Work Might Be Something Like \
+an Em-Dash-Separated List of Subsections or Sundry Other Topics \
+Covered Therein
+.NH 1
+\*(C1
+.XS
+\*(C1
+.XE
+.LP
+This is an
+.I ms
+document.
+.NH 1
+\*(C2
+.XS
+\*(C2
+.XA no
+.in 8n
+\*(C3
+.in
+.XE
+.LP
+It is part of a regression test.
+.TC
+.'
+
+# Expected output (page 2 only):
+# -i-
+#
+#
+#
+# Table of Contents
+#
+#
+# Chapter the First, in which we Ramble On at Excessive
+# Length for the Purpose of Contriving a Table of Contents
+# Entry So Garrulous That It Will Surely Overrun the Line
+# in Any Sensible Page Configuration . . . . . . . . . . . . . 1
+# Chapter the Second, in which we Do Much the Same, but Ap-
+# ply an Added Twist . . . . . . . . . . . . . . . . . . . . . 1
+# Of a Supplement for the Table of Contents, Which
+# in a Traditional Work Might Be Something Like an
+# Em-Dash-Separated List of Subsections or Sundry
+# Other Topics Covered Therein
+
+output=$(printf '%s\n' "$input" | "$groff" -Tascii -P-cbou -ms)
+echo "$output"
+
+echo "testing line length of primary TOC entry" >&2
+echo "$output" | grep -qx 'Chapter the First.*Excessive' || wail
+
+echo "testing line length of supplemental TOC entry" >&2
+echo "$output" | grep -qx ' *Of a Supplement.*, Which' || wail
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 1b6613141..dd47bd393 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -239,6 +239,7 @@ tmac_TESTS = \
tmac/tests/s_SH-resets-IP-indentation-amount.sh \
tmac/tests/s_TC-works-with-percent-in-custom-titles.sh \
tmac/tests/s_XA-literal-no-argument-suppresses-leader.sh \
+ tmac/tests/s_XA-reduces-line-length.sh \
tmac/tests/s_honor-MINGW-when-two-columns.sh \
tmac/tests/s_honor-page-break-after-display.sh \
tmac/tests/s_honor-page-break-in-text.sh \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 10/12: [ms]: Regression-test Savannah #66328.,
G. Branden Robinson <=