gbranden pushed a commit to branch master
in repository groff.

commit 0c641cf88d831eafc50cf384f37979e125b7999f
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 2 07:51:32 2026 -0600

    [soelim]: Test accurate `lf` request production.
    
    * src/preproc/soelim/tests/produces-accurate-lf-requests.sh: New file.
    
    * src/preproc/soelim/soelim.am: Update `soelim_TESTS` to run test.
---
 ChangeLog                                          |  9 +++
 src/preproc/soelim/soelim.am                       |  1 +
 .../soelim/tests/produces-accurate-lf-requests.sh  | 75 ++++++++++++++++++++++
 3 files changed, 85 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 780324107..a985903ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2026-11-02  G. Branden Robinson <[email protected]>
+
+       [soelim]: Test accurate `lf` request production.
+
+       * src/preproc/soelim/tests/produces-accurate-lf-requests.sh: New
+       file.
+       * src/preproc/soelim/soelim.am: Update `soelim_TESTS` to run
+       test.
+
 2026-11-02  G. Branden Robinson <[email protected]>
 
        [soelim]: Test use of leading quotes after `.so` tokens.
diff --git a/src/preproc/soelim/soelim.am b/src/preproc/soelim/soelim.am
index eeef649d0..6d74a370d 100644
--- a/src/preproc/soelim/soelim.am
+++ b/src/preproc/soelim/soelim.am
@@ -24,6 +24,7 @@ EXTRA_DIST += \
 soelim_TESTS = \
   src/preproc/soelim/tests/leading-quote-before-file-name-works.sh \
   src/preproc/soelim/tests/passes-through-input-with-eighth-bit-set.sh \
+  src/preproc/soelim/tests/produces-accurate-lf-requests.sh \
   src/preproc/soelim/tests/smoke-test.sh \
   src/preproc/soelim/tests/space-in-argument-works.sh \
   src/preproc/soelim/tests/x-option-works.sh
diff --git a/src/preproc/soelim/tests/produces-accurate-lf-requests.sh 
b/src/preproc/soelim/tests/produces-accurate-lf-requests.sh
new file mode 100755
index 000000000..1262c546e
--- /dev/null
+++ b/src/preproc/soelim/tests/produces-accurate-lf-requests.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# Copyright 2026 G. Branden Robinson
+#
+# This file is part of groff, the GNU roff typesetting system.
+#
+# 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/>.
+
+soelim="${abs_top_builddir:-.}/soelim"
+
+fail=
+
+wail () {
+  echo "...FAILED" >&2
+  fail=yes
+}
+
+# Locate directory containing our test artifacts.
+artifacts_dir=
+
+for buildroot in . .. ../..
+do
+    d=$buildroot/src/preproc/soelim/tests/artifacts
+    if [ -d "$d" ]
+    then
+        artifacts_dir=$d
+        break
+    fi
+done
+
+# If we can't find it, we can't test.
+if [ -z "$artifacts_dir" ]
+then
+    echo "cannot find test artifact directory; skipping" >&2
+    exit 77 # skip
+fi
+
+output=$(echo "$input" \
+    | "$soelim" -I "$artifacts_dir" "$artifacts_dir"/sorcerer | nl)
+
+# Expected output:
+#     1  .lf 1 "./../src/preproc/soelim/tests/artifacts/sorcerer
+#     2  .lf 1 "../src/preproc/soelim/tests/artifacts/included
+#     3  This file deliberately lacks a trailing newline.
+#     4  included
+#     5  .lf 2 "./../src/preproc/soelim/tests/artifacts/sorcerer
+#     6  stuff
+echo "$output"
+
+echo "checking that soelim produces accurate 'lf' request (1/3)"
+echo "$output" \
+    | grep -qx ' *1.*\.lf 1 ".*artifacts/sorcerer' || wail
+
+echo "checking that soelim produces accurate 'lf' request (2/3)"
+echo "$output" \
+    | grep -qx ' *2.*\.lf 1 ".*artifacts/included' || wail
+
+echo "checking that soelim produces accurate 'lf' request (3/3)"
+echo "$output" \
+    | grep -qx ' *5.*\.lf 2 ".*artifacts/sorcerer' || wail
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to