[PATCH 07/10] tests: nl: check the current section carries over to the n
From:
Pádraig Brady
Subject:
[PATCH 07/10] tests: nl: check the current section carries over to the next file
Date:
Sat, 24 Oct 2026 16:15:35 +0100
From: Sylvestre Ledru <sylvestre@debian.org>
* tests/nl/multiple-files.sh: Ensure a footer and a header started in
one input file go on in the next one, including stdin.
https://github.com/uutils/coreutils/pull/15629
Link: https://github.com/coreutils/coreutils/pull/392
---
tests/nl/multiple-files.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tests/nl/multiple-files.sh b/tests/nl/multiple-files.sh
index 304102cab..32be8dcf3 100755
--- a/tests/nl/multiple-files.sh
+++ b/tests/nl/multiple-files.sh
@@ -30,4 +30,15 @@ EOF
compare exp-out out || fail=1
compare exp-err err || fail=1
+# The input files are a single document, so a section goes on
+# into the next file: a footer started in a goes on in b, and a
+# header started in b goes on in stdin.
+printf 'a\n\\:\n' > a || framework_failure_
+printf 'b\n\\:\\:\\:\n' > b || framework_failure_
+printf '\\:\\:\nd\n' > c || framework_failure_
+printf 'c\n' | nl -h a a b - c > out || fail=1
+printf ' 1\ta\n\n b\n\n 1\tc\n\n 1\td\n' > exp \
+ || framework_failure_
+compare exp out || fail=1
+
Exit $fail
--
2.55.0