From: Sylvestre Ledru <[email protected]>

* 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


Reply via email to