]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: add fold(1) test for --bytes option
authorBernhard Voelker <mail@bernhard-voelker.de>
Sun, 29 Sep 2024 15:39:16 +0000 (17:39 +0200)
committerBernhard Voelker <mail@bernhard-voelker.de>
Mon, 30 Sep 2024 08:07:19 +0000 (10:07 +0200)
Inspired by:
- https://access.redhat.com/solutions/3459791
- https://src.fedoraproject.org/rpms/coreutils/c/8080f5a15a20362c

* tests/misc/fold.pl (bw1, bw2): Add tests for 'fold -b'.

tests/misc/fold.pl

index 3a37840dc1daac289dd34415db85257707a0ac9e..2628f9555948f05515c6d47dd585ae3e73e0adfe 100755 (executable)
@@ -36,6 +36,12 @@ my @Tests =
    # The I18N patch was fixed only in July 2024.  (rhbz#2296201).
    ['enoent', 'enoent', {EXIT => 1},
      {ERR=>"$prog: enoent: No such file or directory\n"}],
+
+   # The downstream I18N patch made 'fold -b' mishandled '\n' in UTF locales.
+   # The I18N patch was fixed only in Sep 2024.  (RHEL-60295)
+   ['bw1', '-b -w 4', {IN=>"abcdef\nghijkl"}, {OUT=>"abcd\nef\nghij\nkl"}],
+   ['bw2', '-b -w 6', {IN=>"1234567890\nabcdefghij\n1234567890"},
+     {OUT=>"123456\n7890\nabcdef\nghij\n123456\n7890"}],
   );
 
 my $save_temps = $ENV{DEBUG};