groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 38/41: [mm]: Regression-test Savannah #60657.


From: G. Branden Robinson
Subject: [groff] 38/41: [mm]: Regression-test Savannah #60657.
Date: Sat, 5 Mar 2022 16:06:22 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit c435ee5d82e1f7b56d91e0b60b125b25c69d8098
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Mar 6 05:13:01 2022 +1100

    [mm]: Regression-test Savannah #60657.
    
    * contrib/mm/tests/remove-stale-bib-entry-data.sh: Do it.
    * contrib/mm/tests/artifacts/60657.ref: Add new file.
    * contrib/mm/mm.am (mm_TESTS): Run test.
      (EXTRA_DIST): Ship test artifact in distribution archive.
    
    Thanks to Bjarni Ingi Gislason for the straightforward bug reproducer.
    
    Test fails at this commit.
---
 ChangeLog                                       | 12 +++++
 contrib/mm/mm.am                                |  7 ++-
 contrib/mm/tests/artifacts/60657.ref            | 11 ++++
 contrib/mm/tests/remove-stale-bib-entry-data.sh | 72 +++++++++++++++++++++++++
 4 files changed, 100 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7253fb07..73cc43ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2022-03-06  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [mm]: Regression-test Savannah #60657.
+
+       * contrib/mm/tests/remove-stale-bib-entry-data.sh: Do it.
+       * contrib/mm/tests/artifacts/60657.ref: Add new file.
+       * contrib/mm/mm.am (mm_TESTS): Run test.
+       (EXTRA_DIST): Ship test artifact in distribution archive.
+
+       Thanks to Bjarni Ingi Gislason for the straightforward
+       bug reproducer.
+
 2022-03-06  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [refer]: Report correct line number in bibliography file
diff --git a/contrib/mm/mm.am b/contrib/mm/mm.am
index 9fe696d3..146bed6a 100644
--- a/contrib/mm/mm.am
+++ b/contrib/mm/mm.am
@@ -64,9 +64,12 @@ mm_TESTS = \
   contrib/mm/tests/LT_SP_AU_without_AT_works.sh \
   contrib/mm/tests/LT_SP_multi-word_LO_SJ_works.sh \
   contrib/mm/tests/MT_5_includes_AT_in_SG.sh \
-  contrib/mm/tests/ms_cover_sheet_robust_to_missing_AF.sh
+  contrib/mm/tests/ms_cover_sheet_robust_to_missing_AF.sh \
+  contrib/mm/tests/remove-stale-bib-entry-data.sh
 TESTS += $(mm_TESTS)
-EXTRA_DIST += $(mm_TESTS)
+EXTRA_DIST += \
+  $(mm_TESTS) \
+  contrib/mm/tests/artifacts/60657.ref
 
 mmroff: $(mm_srcdir)/mmroff.pl
        $(AM_V_GEN)$(SED) -e 's;/usr/bin/perl;$(PERL);' \
diff --git a/contrib/mm/tests/artifacts/60657.ref 
b/contrib/mm/tests/artifacts/60657.ref
new file mode 100644
index 00000000..ed7f6f3a
--- /dev/null
+++ b/contrib/mm/tests/artifacts/60657.ref
@@ -0,0 +1,11 @@
+%K 1
+%A First Author
+%B First Book
+%O Test one
+
+%K 2
+%A Second Author
+%B Second Book
+
+%K 3
+%A Third Author
diff --git a/contrib/mm/tests/remove-stale-bib-entry-data.sh 
b/contrib/mm/tests/remove-stale-bib-entry-data.sh
new file mode 100755
index 00000000..feac7d9e
--- /dev/null
+++ b/contrib/mm/tests/remove-stale-bib-entry-data.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 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 #60657.  Ensure data from a bibliographic
+# entry doesn't carry over to the next.
+
+# Locate our test artifacts.
+artifact_dir=
+
+for buildroot in . .. ../..
+do
+    d=$buildroot/contrib/mm/tests/artifacts
+    if [ -d "$d" ]
+    then
+        artifact_dir=$d
+        break
+    fi
+done
+
+# If we can't find it, we can't test.
+test -z "$artifact_dir" && exit 77 # skip
+
+input=".R1
+bibliography $artifact_dir/60657.ref
+.R2"
+
+output=$(echo "$input" | "$groff" -R -mm -Tascii -P-cbou)
+
+echo "checking first entry"
+echo "$output" \
+    | grep -q "1\. First Author in First Book\. Test one\.$" \
+    || wail
+
+echo "checking second entry"
+echo "$output" \
+    | grep -q "2\. Second Author in Second Book\.$" \
+    || wail
+
+echo "checking third entry"
+echo "$output" \
+    | grep -q "3\. Third Author\.$" \
+    || wail
+
+test -z "$fail" || exit 1
+
+# vim:set ai et sw=4 ts=4 tw=72:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]