[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 25/30: [mm] Regression-test Savannah #63739.
From: |
G. Branden Robinson |
Subject: |
[groff] 25/30: [mm] Regression-test Savannah #63739. |
Date: |
Sat, 12 Oct 2024 12:07:55 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit dcfe27e3de446fe411626a132246d5b5a13afe90
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Oct 12 05:06:07 2024 -0500
[mm] Regression-test Savannah #63739.
Unit-test `nP` macro.
* tests/nP-works.sh: Add unit test.
* mm.am (mm_TESTS): Run test.
Test fails at this commit.
---
contrib/mm/ChangeLog | 7 ++
contrib/mm/mm.am | 1 +
contrib/mm/tests/nP-works.sh | 175 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 183 insertions(+)
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 21ac3f3fa..972f0e352 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,10 @@
+2024-10-12 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ Regression-test Savannah #63739 (unit-test `nP` macro).
+
+ * tests/nP-works.sh: Add unit test.
+ * mm.am (mm_TESTS): Run test.
+
2024-10-12 G. Branden Robinson <g.branden.robinson@gmail.com>
* m.tmac: Trivially refactor. Rename registers for clarity.
diff --git a/contrib/mm/mm.am b/contrib/mm/mm.am
index a78406c6a..f5d35f9e5 100644
--- a/contrib/mm/mm.am
+++ b/contrib/mm/mm.am
@@ -82,6 +82,7 @@ mm_TESTS = \
contrib/mm/tests/memoranda-format-correctly.sh \
contrib/mm/tests/ms-cover-sheet-robust-to-missing-AF.sh \
contrib/mm/tests/mse_has-sufficient-footnote-space.sh \
+ contrib/mm/tests/nP-works.sh \
contrib/mm/tests/place-equation-labels-correctly-in-displays.sh \
contrib/mm/tests/remove-stale-bib-entry-data.sh \
contrib/mm/tests/short-pages-do-not-overflow-stack.sh
diff --git a/contrib/mm/tests/nP-works.sh b/contrib/mm/tests/nP-works.sh
new file mode 100755
index 000000000..55a1755b5
--- /dev/null
+++ b/contrib/mm/tests/nP-works.sh
@@ -0,0 +1,175 @@
+#!/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
+}
+
+input='.
+.H 1 Opus
+.H 2 "De Redrum Unnatura"
+.nP
+Sed ut perspiciatis,
+unde omnis iste natus error sit voluptatem accusantium doloremque
+laudantium,
+totam rem aperiam eaque ipsa,
+quae ab illo inventore veritatis et quasi architecto beatae vitae dicta
+sunt,
+explicabo.
+.nP
+Nemo enim ipsam voluptatem,
+quia voluptas sit,
+aspernatur aut odit aut fugit,
+sed quia consequuntur magni dolores eos,
+qui ratione voluptatem sequi nesciunt,
+neque porro quisquam est,
+qui dolorem ipsum,
+quia dolor sit amet consectetur adipiscivelit,
+sed quia non-numquam eius modi tempora incidunt,
+ut labore et dolore magnam aliquam quaerat voluptatem.
+.H 3 "Siegesbeckia orientalis"
+.nP
+Quis autem vel eum iure reprehenderit,
+qui inea voluptate velit esse,
+quam nihil molestiae consequatur,
+vel illum,
+qui dolorem eum fugiat,
+quo voluptas nulla pariatur?
+.H 2 "Eternalii famishiis"
+.nP
+At vero eos et accusamus et iusto odio dignissimos ducimus,
+qui blanditiis praesentium voluptatum deleniti atque corrupti,
+quos dolores et quas molestias excepturi sint,
+obcaecati cupiditate non-provident,
+similique sunt in culpa,
+qui officia deserunt mollitia animi,
+id est laborum et dolorum fuga.
+.H 2 [redacted]
+.H 2 [redacted]
+.H 2 [redacted]
+.H 2 [redacted]
+.H 2 [redacted]
+.H 2 [redacted]
+.H 2 [redacted]
+.H 2 "Malleus Maleficarum"
+.nP
+Ut enim ad minima veniam,
+quis nostrum exercitationem ullam corporis suscipitlaboriosam,
+nisi ut aliquid ex ea commodi consequatur?
+.'
+
+output=$(printf "%s\n" "$input" | "$groff" -mm -Tascii -P-cbou | cat -s)
+echo "$output"
+
+# Expected output:
+#
+# - 1 -
+#
+# 1. Opus
+#
+# 1.1 De Redrum Unnatura
+#
+# 1.01 Sed ut perspiciatis, unde omnis iste natus error sit
+# voluptatem accusantium doloremque laudantium, totam
+# rem aperiam eaque ipsa, quae ab illo inventore veritatis et
+# quasi architecto beatae vitae dicta sunt, explicabo.
+#
+# 1.02 Nemo enim ipsam voluptatem, quia voluptas sit,
+# aspernatur aut odit aut fugit, sed quia consequuntur
+# magni dolores eos, qui ratione voluptatem sequi nesciunt,
+# neque porro quisquam est, qui dolorem ipsum, quia dolor sit
+# amet consectetur adipiscivelit, sed quia non-numquam eius
+# modi tempora incidunt, ut labore et dolore magnam aliquam
+# quaerat voluptatem.
+#
+# 1.1.1 Siegesbeckia orientalis
+#
+# 1.03 Quis autem vel eum iure reprehenderit, qui inea
+# voluptate velit esse, quam nihil molestiae
+# consequatur, vel illum, qui dolorem eum fugiat, quo voluptas
+# nulla pariatur?
+#
+# 1.2 Eternalii famishiis
+#
+# 2.01 At vero eos et accusamus et iusto odio dignissimos
+# ducimus, qui blanditiis praesentium voluptatum
+# deleniti atque corrupti, quos dolores et quas molestias
+# excepturi sint, obcaecati cupiditate non-provident,
+# similique sunt in culpa, qui officia deserunt mollitia
+# animi, id est laborum et dolorum fuga.
+#
+# 1.3 [redacted]
+#
+# 1.4 [redacted]
+#
+# 1.5 [redacted]
+#
+# 1.6 [redacted]
+#
+# 1.7 [redacted]
+#
+# 1.8 [redacted]
+#
+# 1.9 [redacted]
+#
+# 1.10 Malleus Maleficarum
+#
+# 10.01 Ut enim ad minima veniam, quis nostrum exercitationem
+# ullam corporis suscipitlaboriosam, nisi ut aliquid ex
+# ea commodi consequatur?
+
+echo "checking label of first paragraph" >&2
+echo "$output" | grep -Eq '1\.01 {2}Sed *ut *perspiciatis' || wail
+
+echo "checking indentation of first paragraph, second line" >&2
+echo "$output" | grep -Eq '^ {13}voluptatem *accusantium' || wail
+
+echo "checking label of second paragraph" >&2
+echo "$output" | grep -Eq '1\.02 {2}Nemo *enim *ipsam' || wail
+
+echo "checking indentation of second paragraph, second line" >&2
+echo "$output" | grep -Eq '^ {13}aspernatur *aut *odit' || wail
+
+echo "checking label of third paragraph" >&2
+echo "$output" | grep -Eq '1\.03 {2}Quis *autem *vel' || wail
+
+echo "checking indentation of third paragraph, second line" >&2
+echo "$output" | grep -Eq '^ {13}voluptate *velit *esse' || wail
+
+echo "checking label of fourth paragraph" >&2
+echo "$output" | grep -Eq '2\.01 {2}At *vero *eos *et' || wail
+
+echo "checking indentation of fourth paragraph, second line" >&2
+echo "$output" | grep -Eq '^ {13}ducimus, *qui *blanditiis' || wail
+
+echo "checking label of fifth paragraph" >&2
+echo "$output" | grep -Eq '10\.01 {2}Ut *enim *ad *minima' || wail
+
+echo "checking indentation of fifth paragraph, second line" >&2
+echo "$output" | grep -Eq '^ {14}ullam *corporis' || wail
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 25/30: [mm] Regression-test Savannah #63739.,
G. Branden Robinson <=