]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: paste: check the delimiter is reset for each file when -s is used
authorCollin Funk <collin.funk1@gmail.com>
Sat, 18 Jul 2026 04:56:03 +0000 (21:56 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Sat, 18 Jul 2026 04:56:36 +0000 (21:56 -0700)
* tests/paste/paste.pl (@Tests): Add a test case.

tests/paste/paste.pl

index c890a2a566ce0fccd80bf552d62b527f785b6ccc..3a1be1781158c5ce585002e4a544edddca82e7fa 100755 (executable)
@@ -69,6 +69,11 @@ my @Tests =
    # \0 allows cycling through an empty delimiter (while "-d ''" does not)
    ['delim-empty-1', q{-s -d '\0,'}, {IN=>"1\n2\n3\n"}, {OUT=>"12,3\n"}],
 
+   # POSIX says that when -s is specified, the delimiter should reset to
+   # the first element of the list after each file is processed.
+   ['s-file-reset-1', '-s -d abc', {IN=>"0\n1\n"}, {IN=>"2\n3\n4\n5\n6\n"},
+    {IN=>"7\n8\n9\n"}, {OUT=>"0a1\n2a3b4c5a6\n7a8b9\n"}],
+
    # POSIX escapes
    ['delim-esc-0', q{-s -d '\0'},   {IN=>"1\n2\n"}, {OUT=>"12\n"}],
    ['delim-esc-n', q{-s -d '\n'},   {IN=>"1\n2\n"}, {OUT=>"1\n2\n"}],